From: Roy Marples Date: Tue, 29 Mar 2011 10:36:17 +0000 (+0000) Subject: When operating on one interface only, respect the configured timeout. X-Git-Tag: v5.2.12~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d796699f002876a72d7543d426a5d42991f0b05;p=thirdparty%2Fdhcpcd.git When operating on one interface only, respect the configured timeout. --- diff --git a/dhcpcd.c b/dhcpcd.c index 9414b980..11d96d45 100644 --- 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);