mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
dev: advertise the new nsid when the netns iface changes
x-netns interfaces are bound to two netns: the link netns and the upper netns. Usually, this kind of interfaces is created in the link netns and then moved to the upper netns. At the end, the interface is visible only in the upper netns. The link nsid is advertised via netlink in the upper netns, thus the user always knows where is the link part. There is no such mechanism in the link netns. When the interface is moved to another netns, the user cannot "follow" it. This patch adds a new netlink attribute which helps to follow an interface which moves to another netns. When the interface is unregistered, the new nsid is advertised. If the interface is a x-netns interface (ie rtnl_link_ops->get_link_net is defined), the nsid is allocated if needed. CC: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b295edc54b
commit
6621dd29eb
4 changed files with 34 additions and 13 deletions
|
@ -17,9 +17,11 @@ extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst,
|
|||
u32 id, long expires, u32 error);
|
||||
|
||||
void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change, gfp_t flags);
|
||||
void rtmsg_ifinfo_newnet(int type, struct net_device *dev, unsigned int change,
|
||||
gfp_t flags, int *new_nsid);
|
||||
struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev,
|
||||
unsigned change, u32 event,
|
||||
gfp_t flags);
|
||||
gfp_t flags, int *new_nsid);
|
||||
void rtmsg_ifinfo_send(struct sk_buff *skb, struct net_device *dev,
|
||||
gfp_t flags);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue