diff options
| author | Roy Marples <roy@marples.name> | 2009-10-08 19:56:52 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-10-08 19:56:52 +0000 |
| commit | f19df563b046a25ef610ba6960eabdb72dae49a7 (patch) | |
| tree | 48472a6010b22a509b505b0b39b4677b2179205d /dhcpcd.c | |
| parent | 26071224a25bd9e536ec0c2683d1c3f2cad683d7 (diff) | |
| download | dhcpcd-f19df563b046a25ef610ba6960eabdb72dae49a7.tar.xz | |
Add an extra timeout for IPv4LL when in use.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -185,11 +185,18 @@ cleanup(void) } /* ARGSUSED */ -_noreturn void +void handle_exit_timeout(_unused void *arg) { + int timeout; + syslog(LOG_ERR, "timed out"); - exit(EXIT_FAILURE); + if (!(options & DHCPCD_TIMEOUT_IPV4LL)) + exit(EXIT_FAILURE); + options &= ~DHCPCD_TIMEOUT_IPV4LL; + timeout = (PROBE_NUM * PROBE_MAX) + PROBE_WAIT + 1; + syslog(LOG_WARNING, "allowing %d seconds for IPv4LL timeout", timeout); + add_timeout_sec(timeout, handle_exit_timeout, NULL); } void @@ -1766,6 +1773,8 @@ main(int argc, char **argv) { daemonise(); } else if (options & DHCPCD_DAEMONISE && ifo->timeout > 0) { + if (options & DHCPCD_IPV4LL) + options |= DHCPCD_TIMEOUT_IPV4LL; add_timeout_sec(ifo->timeout, handle_exit_timeout, NULL); } free_options(ifo); |
