net: have ipconfig not wait if no dev is available
authorGerlando Falauto <gerlando.falauto@keymile.com>
Mon, 19 Dec 2011 22:58:04 +0000 (22:58 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 6 Jan 2012 22:14:08 +0000 (14:14 -0800)
[ Upstream commit cd7816d14953c8af910af5bb92f488b0b277e29d ]

previous commit 3fb72f1e6e6165c5f495e8dc11c5bbd14c73385c
makes IP-Config wait for carrier on at least one network device.

Before waiting (predefined value 120s), check that at least one device
was successfully brought up. Otherwise (e.g. buggy bootloader
which does not set the MAC address) there is no point in waiting
for carrier.

Cc: Micha Nelissen <micha@neli.hopto.org>
Cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/ipconfig.c

index ab7e5542c1cff9203b8c5e21108eb83cb5a27515..7fbcabafa29b43ab0cff0cd32bdfba616724e8fa 100644 (file)
@@ -252,6 +252,10 @@ static int __init ic_open_devs(void)
                }
        }
 
+       /* no point in waiting if we could not bring up at least one device */
+       if (!ic_first_dev)
+               goto have_carrier;
+
        /* wait for a carrier on at least one device */
        start = jiffies;
        while (jiffies - start < msecs_to_jiffies(CONF_CARRIER_TIMEOUT)) {