aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ipconfig.c')
-rw-r--r--net/ipv4/ipconfig.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index bf6c5cf31aed..efa1138fa523 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -206,7 +206,7 @@ static int __init ic_open_devs(void)
206 struct ic_device *d, **last; 206 struct ic_device *d, **last;
207 struct net_device *dev; 207 struct net_device *dev;
208 unsigned short oflags; 208 unsigned short oflags;
209 unsigned long start; 209 unsigned long start, next_msg;
210 210
211 last = &ic_first_dev; 211 last = &ic_first_dev;
212 rtnl_lock(); 212 rtnl_lock();
@@ -263,12 +263,23 @@ static int __init ic_open_devs(void)
263 263
264 /* wait for a carrier on at least one device */ 264 /* wait for a carrier on at least one device */
265 start = jiffies; 265 start = jiffies;
266 next_msg = start + msecs_to_jiffies(CONF_CARRIER_TIMEOUT/12);
266 while (jiffies - start < msecs_to_jiffies(CONF_CARRIER_TIMEOUT)) { 267 while (jiffies - start < msecs_to_jiffies(CONF_CARRIER_TIMEOUT)) {
268 int wait, elapsed;
269
267 for_each_netdev(&init_net, dev) 270 for_each_netdev(&init_net, dev)
268 if (ic_is_init_dev(dev) && netif_carrier_ok(dev)) 271 if (ic_is_init_dev(dev) && netif_carrier_ok(dev))
269 goto have_carrier; 272 goto have_carrier;
270 273
271 msleep(1); 274 msleep(1);
275
276 if time_before(jiffies, next_msg)
277 continue;
278
279 elapsed = jiffies_to_msecs(jiffies - start);
280 wait = (CONF_CARRIER_TIMEOUT - elapsed + 500)/1000;
281 pr_info("Waiting up to %d more seconds for network.\n", wait);
282 next_msg = jiffies + msecs_to_jiffies(CONF_CARRIER_TIMEOUT/12);
272 } 283 }
273have_carrier: 284have_carrier:
274 rtnl_unlock(); 285 rtnl_unlock();