[SRU,Bionic,2/3] dev: always advertise the new nsid when the netns iface changes

Message ID 400817af412aa8dc00e7c6da69a0afdacca5b480.1528477213.git.joseph.salisbury@canonical.com
State New
Headers show
  • Fixes for LP:1774225
Related show

Commit Message

Joseph Salisbury June 22, 2018, 5:49 p.m.
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>

BugLink: http://bugs.launchpad.net/bugs/1774225

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 <jbenc@redhat.com>
CC: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c36ac8e2307334c83e8bf81ed361f0e4959d995f)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
 net/core/dev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)


diff --git a/net/core/dev.c b/net/core/dev.c
index af4d670..3b4e400 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8426,10 +8426,7 @@  int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 	call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
 	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);