aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d334446a8eaf..4addaf0df96e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4480,17 +4480,19 @@ static void __net_exit default_device_exit(struct net *net)
4480 rtnl_lock(); 4480 rtnl_lock();
4481 for_each_netdev_safe(net, dev, next) { 4481 for_each_netdev_safe(net, dev, next) {
4482 int err; 4482 int err;
4483 char fb_name[IFNAMSIZ];
4483 4484
4484 /* Ignore unmoveable devices (i.e. loopback) */ 4485 /* Ignore unmoveable devices (i.e. loopback) */
4485 if (dev->features & NETIF_F_NETNS_LOCAL) 4486 if (dev->features & NETIF_F_NETNS_LOCAL)
4486 continue; 4487 continue;
4487 4488
4488 /* Push remaing network devices to init_net */ 4489 /* Push remaing network devices to init_net */
4489 err = dev_change_net_namespace(dev, &init_net, "dev%d"); 4490 snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex);
4491 err = dev_change_net_namespace(dev, &init_net, fb_name);
4490 if (err) { 4492 if (err) {
4491 printk(KERN_WARNING "%s: failed to move %s to init_net: %d\n", 4493 printk(KERN_EMERG "%s: failed to move %s to init_net: %d\n",
4492 __func__, dev->name, err); 4494 __func__, dev->name, err);
4493 unregister_netdevice(dev); 4495 BUG();
4494 } 4496 }
4495 } 4497 }
4496 rtnl_unlock(); 4498 rtnl_unlock();