From: Roy Marples Date: Wed, 23 Jul 2008 10:32:00 +0000 (+0000) Subject: Fix mini timeouts and starting ipv4ll when link is down and we try to renew a lease. X-Git-Tag: v4.0.2~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e86d3d17f9bd7d383583acde98f671f602ddb7f;p=thirdparty%2Fdhcpcd.git Fix mini timeouts and starting ipv4ll when link is down and we try to renew a lease. --- diff --git a/client.c b/client.c index 64d604f3..93fbce70 100644 --- a/client.c +++ b/client.c @@ -1077,7 +1077,8 @@ handle_timeout_fail(struct if_state *state, const struct options *options) return 1; case STATE_BOUND: logger(LOG_INFO, "renewing lease of %s",inet_ntoa(lease->addr)); - do_socket(state, SOCKET_OPEN); + if (state->carrier != LINK_DOWN) + do_socket(state, SOCKET_OPEN); state->xid = arc4random(); state->state = STATE_RENEWING; tv.tv_sec = lease->rebindtime - lease->renewaltime; @@ -1093,7 +1094,8 @@ handle_timeout_fail(struct if_state *state, const struct options *options) break; case STATE_REBINDING: logger(LOG_ERR, "failed to rebind"); - if (state->options & DHCPCD_IPV4LL) + if (state->options & DHCPCD_IPV4LL && + state->carrier != LINK_DOWN) state->state = STATE_INIT_IPV4LL; else { reason = "EXPIRE"; @@ -1306,6 +1308,10 @@ handle_timeout(struct if_state *state, const struct options *options) #ifdef ENABLE_ARP dhcp_timeout: #endif + if (state->carrier == LINK_DOWN) { + timerclear(&state->timeout); + return 0; + } get_time(&state->timeout); tv.tv_sec = DHCP_BASE; for (i = 1; i < state->messages; i++) {