All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] netns: audit netdevice creation with IFLA_NET_NS_[PID|FD]
@ 2015-01-26 21:28 Nicolas Dichtel
  2015-01-26 21:28 ` [PATCH net 1/2] caif: remove wrong dev_net_set() call Nicolas Dichtel
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Nicolas Dichtel @ 2015-01-26 21:28 UTC (permalink / raw)
  To: netdev; +Cc: davem, dmitry.tarnyagin, arvid.brodin, alex.aring, linux-wpan


When one of these attributes is set, the netdevice is created into the netns
pointed by IFLA_NET_NS_[PID|FD] (see the call to rtnl_create_link() in
rtnl_newlink()). Let's call this netns the dest_net. After this creation, if the
newlink handler exists, it is called with a netns argument that points to the
netns where the netlink message has been received (called src_net in the code)
which is the link netns.
Hence, with one of these attributes, it's possible to create a x-netns
netdevice.

Here is the result of my code review:
- all ip tunnels (sit, ipip, ip6_tunnels, gre[tap][v6], ip_vti[6]) does not
  really allows to use this feature: the netdevice is created in the dest_net
  and the src_net is completely ignored in the newlink handler.
- VLAN properly handles this x-netns creation.
- bridge ignores src_net, which seems fine (NETIF_F_NETNS_LOCAL is set).
- CAIF subsystem is not clear for me (I don't know how it works), but it seems
  to wrongly use src_net. Patch #1 tries to fix this, but it was done only by
  code review (and only compile-tested), so please carefully review it. I may
  miss something.
- HSR subsystem uses src_net to parse IFLA_HSR_SLAVE[1|2], but the netdevice has
  the flag NETIF_F_NETNS_LOCAL, so the question is: does this netdevice really
  supports x-netns? If not, the newlink handler should use the dest_net instead
  of src_net, I can provide the patch.
- ieee802154 uses also src_net and does not have NETIF_F_NETNS_LOCAL. Same
  question: does this netdevice really supports x-netns?
- bonding ignores src_net and flag NETIF_F_NETNS_LOCAL is set, ie x-netns is not
  supported. Fine.
- CAN does not support rtnl/newlink, ok.
- ipvlan uses src_net and does not have NETIF_F_NETNS_LOCAL. After looking at
  the code, it seems that this drivers support x-netns. Am I right?
- macvlan/macvtap uses src_net and seems to have x-netns support.
- team ignores src_net and has the flag NETIF_F_NETNS_LOCAL, ie x-netns is not
  supported. Ok.
- veth uses src_net and have x-netns support ;-) Ok.
- VXLAN didn't properly handle this. The link netns (vxlan->net) is the src_net
  and not dest_net (see patch #2). Note that it was already possible to create a
  x-netns vxlan before the commit f01ec1c017de ("vxlan: add x-netns support")
  but the nedevice remains broken.

To summarize:
 - CAIF patch must be carefully reviewed
 - for HSR, ieee802154, ipvlan: is x-netns supported?

 drivers/net/caif/caif_hsi.c |  1 -
 drivers/net/vxlan.c         | 10 +++++-----
 net/caif/chnl_net.c         |  1 -
 3 files changed, 5 insertions(+), 7 deletions(-)

Regards,
Nicolas

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

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

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 21:28 [PATCH net 0/2] netns: audit netdevice creation with IFLA_NET_NS_[PID|FD] Nicolas Dichtel
2015-01-26 21:28 ` [PATCH net 1/2] caif: remove wrong dev_net_set() call Nicolas Dichtel
2015-01-27 11:34   ` Nicolas Dichtel
2015-01-27 12:41     ` Bjørn Mork
2015-01-27 12:50       ` Nicolas Dichtel
2015-01-28 15:07   ` Nicolas Dichtel
2015-01-26 21:28 ` [PATCH net 2/2] vxlan: setup the right link netns in newlink hdlr Nicolas Dichtel
2015-01-27  9:34 ` [PATCH net 0/2] netns: audit netdevice creation with IFLA_NET_NS_[PID|FD] Alexander Aring
2015-01-27 10:32   ` Nicolas Dichtel
2015-01-27 12:23     ` Alexander Aring
2015-01-27 12:51       ` Alexander Aring
2015-01-27 13:28       ` Nicolas Dichtel
2015-01-27 14:06         ` Alexander Aring
2015-01-27 14:50           ` Nicolas Dichtel
2015-01-27 20:26             ` Alexander Aring
2015-01-28  9:37               ` Nicolas Dichtel
2015-01-29 22:20 ` David Miller
2015-01-30 20:00 ` Arvid Brodin
2015-01-30 20:00   ` Arvid Brodin
2015-02-02 15:58   ` Nicolas Dichtel
2015-02-04 20:33     ` Arvid Brodin
2015-02-04 20:33       ` Arvid Brodin
2015-02-05 14:34       ` Nicolas Dichtel

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.