diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index bb37ee1e0901..e3e18dee0bd3 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5736,14 +5736,13 @@ static struct pernet_operations __net_initdata netdev_net_ops = { | |||
5736 | 5736 | ||
5737 | static void __net_exit default_device_exit(struct net *net) | 5737 | static void __net_exit default_device_exit(struct net *net) |
5738 | { | 5738 | { |
5739 | struct net_device *dev; | 5739 | struct net_device *dev, *aux; |
5740 | /* | 5740 | /* |
5741 | * Push all migratable of the network devices back to the | 5741 | * Push all migratable network devices back to the |
5742 | * initial network namespace | 5742 | * initial network namespace |
5743 | */ | 5743 | */ |
5744 | rtnl_lock(); | 5744 | rtnl_lock(); |
5745 | restart: | 5745 | for_each_netdev_safe(net, dev, aux) { |
5746 | for_each_netdev(net, dev) { | ||
5747 | int err; | 5746 | int err; |
5748 | char fb_name[IFNAMSIZ]; | 5747 | char fb_name[IFNAMSIZ]; |
5749 | 5748 | ||
@@ -5751,11 +5750,9 @@ restart: | |||
5751 | if (dev->features & NETIF_F_NETNS_LOCAL) | 5750 | if (dev->features & NETIF_F_NETNS_LOCAL) |
5752 | continue; | 5751 | continue; |
5753 | 5752 | ||
5754 | /* Delete virtual devices */ | 5753 | /* Leave virtual devices for the generic cleanup */ |
5755 | if (dev->rtnl_link_ops && dev->rtnl_link_ops->dellink) { | 5754 | if (dev->rtnl_link_ops) |
5756 | dev->rtnl_link_ops->dellink(dev, NULL); | 5755 | continue; |
5757 | goto restart; | ||
5758 | } | ||
5759 | 5756 | ||
5760 | /* Push remaing network devices to init_net */ | 5757 | /* Push remaing network devices to init_net */ |
5761 | snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex); | 5758 | snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex); |
@@ -5765,7 +5762,6 @@ restart: | |||
5765 | __func__, dev->name, err); | 5762 | __func__, dev->name, err); |
5766 | BUG(); | 5763 | BUG(); |
5767 | } | 5764 | } |
5768 | goto restart; | ||
5769 | } | 5765 | } |
5770 | rtnl_unlock(); | 5766 | rtnl_unlock(); |
5771 | } | 5767 | } |