From 057f67b1cac25e2ccddfd546f82fa03195afa560 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sun, 29 Nov 2009 22:25:30 +0000 Subject: [PATCH] --- yaml --- r: 172038 b: refs/heads/master c: e008b5fc8dc7f46d9904001c7a2155eb1e7d35ab h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/core/dev.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index f076a654ab4a..ad2fe962919c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 999b6d39abb4fc446f3465ca4e0a7ac747f49aec +refs/heads/master: e008b5fc8dc7f46d9904001c7a2155eb1e7d35ab diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index bb37ee1e0901..e3e18dee0bd3 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -5736,14 +5736,13 @@ static struct pernet_operations __net_initdata netdev_net_ops = { static void __net_exit default_device_exit(struct net *net) { - struct net_device *dev; + struct net_device *dev, *aux; /* - * Push all migratable of the network devices back to the + * Push all migratable network devices back to the * initial network namespace */ rtnl_lock(); -restart: - for_each_netdev(net, dev) { + for_each_netdev_safe(net, dev, aux) { int err; char fb_name[IFNAMSIZ]; @@ -5751,11 +5750,9 @@ static void __net_exit default_device_exit(struct net *net) if (dev->features & NETIF_F_NETNS_LOCAL) continue; - /* Delete virtual devices */ - if (dev->rtnl_link_ops && dev->rtnl_link_ops->dellink) { - dev->rtnl_link_ops->dellink(dev, NULL); - goto restart; - } + /* Leave virtual devices for the generic cleanup */ + if (dev->rtnl_link_ops) + continue; /* Push remaing network devices to init_net */ snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex); @@ -5765,7 +5762,6 @@ static void __net_exit default_device_exit(struct net *net) __func__, dev->name, err); BUG(); } - goto restart; } rtnl_unlock(); }