]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: pass link_net to the newlink handler
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Tue, 27 Jan 2015 10:13:08 +0000 (11:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Jan 2015 22:23:25 +0000 (14:23 -0800)
commit65531e2f26ddfba49d277dcceb55366448d8460f
treeae7eee9848ab34d3e9dc7a2db1ede28a4d2a7775
parent11164840cffd0f91fbc0a7c0cef580a821e3d967
rtnetlink: pass link_net to the newlink handler

When IFLA_LINK_NETNSID is used, the netdevice should be built in this link netns
and moved at the end to another netns (pointed by the socket netns or
IFLA_NET_NS_[PID|FD]).

Existing user of the newlink handler will use the netns argument (src_net) to
find a link netdevice or to check some other information into the link netns.
For example, to find a netdevice, two information are required: an ifindex
(usually from IFLA_LINK) and a netns (this link netns).

Note: when using IFLA_LINK_NETNSID and IFLA_NET_NS_[PID|FD], a user may create a
netdevice that stands in netnsX and with its link part in netnsY, by sending a
rtnl message from netnsZ.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c