]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When operating on one interface only, respect the configured timeout.
authorRoy Marples <roy@marples.name>
Tue, 29 Mar 2011 10:36:17 +0000 (10:36 +0000)
committerRoy Marples <roy@marples.name>
Tue, 29 Mar 2011 10:36:17 +0000 (10:36 +0000)
dhcpcd.c

index 9414b9807edb5fa4acb3c2ab01c9af3b85c02c1a..11d96d454a1ac092fc22ff403d41e785e174a3f6 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -2025,17 +2025,20 @@ main(int argc, char **argv)
                                }
                        }
                }
+               if (options & DHCPCD_MASTER)
+                       i = if_options->timeout;
+               else
+                       i = ifaces->state->options->timeout;
                if (opt == 0 &&
                    options & DHCPCD_LINK &&
                    !(options & DHCPCD_WAITIP))
                {
                        syslog(LOG_WARNING, "no interfaces have a carrier");
                        daemonise();
-               } else if (if_options->timeout > 0) {
+               } else if (i > 0) {
                        if (options & DHCPCD_IPV4LL)
                                options |= DHCPCD_TIMEOUT_IPV4LL;
-                       add_timeout_sec(if_options->timeout,
-                           handle_exit_timeout, NULL);
+                       add_timeout_sec(i, handle_exit_timeout, NULL);
                }
        }
        free_options(if_options);