diff options
Diffstat (limited to 'net/ipv4/ipconfig.c')
-rw-r--r-- | net/ipv4/ipconfig.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 2d2e0cda0470..af5d5b39fc13 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -190,11 +190,15 @@ static int __init ic_open_devs(void) | |||
190 | rtnl_lock(); | 190 | rtnl_lock(); |
191 | 191 | ||
192 | /* bring loopback device up first */ | 192 | /* bring loopback device up first */ |
193 | if (dev_change_flags(loopback_dev, loopback_dev->flags | IFF_UP) < 0) | 193 | for_each_netdev(&init_net, dev) { |
194 | printk(KERN_ERR "IP-Config: Failed to open %s\n", loopback_dev->name); | 194 | if (!(dev->flags & IFF_LOOPBACK)) |
195 | continue; | ||
196 | if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) | ||
197 | printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name); | ||
198 | } | ||
195 | 199 | ||
196 | for_each_netdev(&init_net, dev) { | 200 | for_each_netdev(&init_net, dev) { |
197 | if (dev == loopback_dev) | 201 | if (dev->flags & IFF_LOOPBACK) |
198 | continue; | 202 | continue; |
199 | if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) : | 203 | if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) : |
200 | (!(dev->flags & IFF_LOOPBACK) && | 204 | (!(dev->flags & IFF_LOOPBACK) && |