All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] veth: set iflink to the peer veth
@ 2015-02-03 15:41 Nicolas Dichtel
  2015-02-03 16:12 ` Eric Dumazet
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Dichtel @ 2015-02-03 15:41 UTC (permalink / raw)
  To: netdev; +Cc: davem, Nicolas Dichtel

Now that the peer netns is advertised in rtnl messages, we can set this property
so that IFLA_LINK will advertise the peer ifindex. It allows the userland to get
the full veth configuration.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 drivers/net/veth.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 4cca36ebc4fb..02d1f798a371 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -427,9 +427,11 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 
 	priv = netdev_priv(dev);
 	rcu_assign_pointer(priv->peer, peer);
+	dev->iflink = peer->ifindex;
 
 	priv = netdev_priv(peer);
 	rcu_assign_pointer(priv->peer, dev);
+	peer->iflink = dev->ifindex;
 	return 0;
 
 err_register_dev:
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-04-02 18:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 15:41 [PATCH net-next] veth: set iflink to the peer veth Nicolas Dichtel
2015-02-03 16:12 ` Eric Dumazet
2015-02-03 16:21   ` Nicolas Dichtel
2015-04-02 15:06   ` [PATCH net-next v2 0/12] Remove iflink field from the net_device structure Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 01/12] dev: introduce dev_get_iflink() Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 02/12] ip6tnl,gre6,vti6: implement ndo_get_iflink Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 03/12] ipip,gre,vti,sit: " Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 04/12] ipmr,ip6mr: " Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 05/12] vlan: " Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 06/12] macvlan: " Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 07/12] ipvlan: " Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 08/12] infiniband/ipoib: " Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 09/12] dsa: " Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 10/12] net: remove iflink field from struct net_device Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 11/12] dev: set iflink to 0 for virtual interfaces Nicolas Dichtel
2015-04-02 15:07     ` [PATCH net-next v2 12/12] veth: set iflink to the peer veth Nicolas Dichtel
2015-04-02 18:05     ` [PATCH net-next v2 0/12] Remove iflink field from the net_device structure David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.