Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368817
b: refs/heads/master
c: 5e404cd
h: refs/heads/master
i:
  368815: 977092e
v: v3
  • Loading branch information
Paul Gortmaker authored and David S. Miller committed Apr 2, 2013
1 parent 4fb4374 commit c371ce4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7f22874267bddcf2f2017d5045fdce390aee8c8
refs/heads/master: 5e404cd65860d6da7c08362e9e4d0b5dc40a9985
13 changes: 12 additions & 1 deletion trunk/net/ipv4/ipconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static int __init ic_open_devs(void)
struct ic_device *d, **last;
struct net_device *dev;
unsigned short oflags;
unsigned long start;
unsigned long start, next_msg;

last = &ic_first_dev;
rtnl_lock();
Expand Down Expand Up @@ -263,12 +263,23 @@ static int __init ic_open_devs(void)

/* wait for a carrier on at least one device */
start = jiffies;
next_msg = start + msecs_to_jiffies(CONF_CARRIER_TIMEOUT/12);
while (jiffies - start < msecs_to_jiffies(CONF_CARRIER_TIMEOUT)) {
int wait, elapsed;

for_each_netdev(&init_net, dev)
if (ic_is_init_dev(dev) && netif_carrier_ok(dev))
goto have_carrier;

msleep(1);

if time_before(jiffies, next_msg)
continue;

elapsed = jiffies_to_msecs(jiffies - start);
wait = (CONF_CARRIER_TIMEOUT - elapsed + 500)/1000;
pr_info("Waiting up to %d more seconds for network.\n", wait);
next_msg = jiffies + msecs_to_jiffies(CONF_CARRIER_TIMEOUT/12);
}
have_carrier:
rtnl_unlock();
Expand Down

0 comments on commit c371ce4

Please sign in to comment.