From: Nicolas Dichtel Date: Thu, 25 Jan 2018 14:01:38 +0000 (+0100) Subject: dev: always advertise the new nsid when the netns iface changes X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=c36ac8e2307334c83e8bf81ed361f0e4959d995f;p=openwrt%2Fstaging%2Fblogic.git dev: always advertise the new nsid when the netns iface changes The user should be able to follow any interface that moves to another netns. There is no reason to hide physical interfaces. CC: Jiri Benc CC: Christian Brauner Signed-off-by: Nicolas Dichtel Reviewed-by: Jiri Benc Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 4670ccabe23a..59987eb6511a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -8529,10 +8529,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char call_netdevice_notifiers(NETDEV_UNREGISTER, dev); rcu_barrier(); call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev); - if (dev->rtnl_link_ops && dev->rtnl_link_ops->get_link_net) - new_nsid = peernet2id_alloc(dev_net(dev), net); - else - new_nsid = peernet2id(dev_net(dev), net); + new_nsid = peernet2id_alloc(dev_net(dev), net); rtmsg_ifinfo_newnet(RTM_DELLINK, dev, ~0U, GFP_KERNEL, &new_nsid); /*