From: Roy Marples Date: Sun, 27 Jul 2008 10:17:36 +0000 (+0000) Subject: Don't set a sop timeout when bound to an infinite lease after announcing. X-Git-Tag: v4.0.2~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=535b7c047926169711ce800fdccd8aca48967122;p=thirdparty%2Fdhcpcd.git Don't set a sop timeout when bound to an infinite lease after announcing. --- diff --git a/client.c b/client.c index 04adff05..8be18930 100644 --- a/client.c +++ b/client.c @@ -1191,27 +1191,29 @@ handle_timeout(struct if_state *state, const struct options *options) state->new->yiaddr, state->new->yiaddr); if (i == -1) logger(LOG_ERR, "send_arp: %s", strerror(errno)); - if (state->claims < ANNOUNCE_NUM) { - tv.tv_sec = ANNOUNCE_INTERVAL; - i = 0; - } else if (IN_LINKLOCAL(htonl(state->new->yiaddr))) { - /* We should pretend to be at the end - * of the DHCP negotation cycle */ - state->state = STATE_INIT; - state->messages = DHCP_MAX / DHCP_BASE; - state->probes = 0; - state->claims = 0; - timerclear(&state->stop); - goto dhcp_timeout; - } else { - state->state = STATE_BOUND; - close(iface->arp_fd); - iface->arp_fd = -1; + } + if (state->claims < ANNOUNCE_NUM) { + tv.tv_sec = ANNOUNCE_INTERVAL; + i = 0; + } else if (IN_LINKLOCAL(htonl(state->new->yiaddr))) { + /* We should pretend to be at the end + * of the DHCP negotation cycle */ + state->state = STATE_INIT; + state->messages = DHCP_MAX / DHCP_BASE; + state->probes = 0; + state->claims = 0; + timerclear(&state->stop); + goto dhcp_timeout; + } else { + state->state = STATE_BOUND; + close(iface->arp_fd); + iface->arp_fd = -1; + if (lease->leasetime != ~0U) { clock_monotonic(&state->stop); state->stop.tv_sec += lease->renewaltime - (ANNOUNCE_INTERVAL * ANNOUNCE_NUM); - return 0; } + return 0; } break; }