Merge remote-tracking branch 'sound-asoc/for-next'
[deliverable/linux.git] / net / ipv4 / ipconfig.c
index 5af6736bd384adf789c59dca03e65b8aa34ccad0..071a785c65eb7ab5eef6294888e253ef39f45c45 100644 (file)
@@ -85,7 +85,6 @@
 /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */
 #define CONF_OPEN_RETRIES      2       /* (Re)open devices twice */
 #define CONF_SEND_RETRIES      6       /* Send six requests per open */
-#define CONF_INTER_TIMEOUT     (HZ)    /* Inter-device timeout: 1 second */
 #define CONF_BASE_TIMEOUT      (HZ*2)  /* Initial timeout: 2 seconds */
 #define CONF_TIMEOUT_RANDOM    (HZ)    /* Maximum amount of randomization */
 #define CONF_TIMEOUT_MULT      *7/4    /* Rate of timeout growth */
@@ -307,7 +306,7 @@ static void __init ic_close_devs(void)
        while ((d = next)) {
                next = d->next;
                dev = d->dev;
-               if (dev != ic_dev->dev && !netdev_uses_dsa(dev)) {
+               if ((!ic_dev || dev != ic_dev->dev) && !netdev_uses_dsa(dev)) {
                        pr_debug("IP-Config: Downing %s\n", dev->name);
                        dev_change_flags(dev, d->flags);
                }
@@ -1225,9 +1224,11 @@ static int __init ic_dynamic(void)
                        ic_rarp_send_if(d);
 #endif
 
-               jiff = jiffies + (d->next ? CONF_INTER_TIMEOUT : timeout);
-               while (time_before(jiffies, jiff) && !ic_got_reply)
-                       schedule_timeout_uninterruptible(1);
+               if (!d->next) {
+                       jiff = jiffies + timeout;
+                       while (time_before(jiffies, jiff) && !ic_got_reply)
+                               schedule_timeout_uninterruptible(1);
+               }
 #ifdef IPCONFIG_DHCP
                /* DHCP isn't done until we get a DHCPACK. */
                if ((ic_got_reply & IC_BOOTP) &&
@@ -1491,14 +1492,6 @@ static int __init ip_auto_config(void)
        if (ic_defaults() < 0)
                return -1;
 
-       /*
-        * Close all network devices except the device we've
-        * autoconfigured and set up routes.
-        */
-       ic_close_devs();
-       if (ic_setup_if() < 0 || ic_setup_routes() < 0)
-               return -1;
-
        /*
         * Record which protocol was actually used.
         */
@@ -1533,7 +1526,18 @@ static int __init ip_auto_config(void)
        pr_cont("\n");
 #endif /* !SILENT */
 
-       return 0;
+       /*
+        * Close all network devices except the device we've
+        * autoconfigured and set up routes.
+        */
+       if (ic_setup_if() < 0 || ic_setup_routes() < 0)
+               err = -1;
+       else
+               err = 0;
+
+       ic_close_devs();
+
+       return err;
 }
 
 late_initcall(ip_auto_config);
This page took 0.026046 seconds and 5 git commands to generate.