From: Roy Marples Date: Tue, 22 Jul 2008 06:58:11 +0000 (+0000) Subject: Always expire lease on probe failure. We should do this as the LAN we hot swap too... X-Git-Tag: v4.0.2~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d59ecd08c8f2f69349481d8483822379d6b996bd;p=thirdparty%2Fdhcpcd.git Always expire lease on probe failure. We should do this as the LAN we hot swap too could deny our IPv4LL probes are a while and this is safer. --- diff --git a/client.c b/client.c index d43d2d53..64d604f3 100644 --- a/client.c +++ b/client.c @@ -1593,17 +1593,21 @@ handle_arp_fail(struct if_state *state, const struct options *options) time_t up; if (IN_LINKLOCAL(htonl(state->fail.s_addr))) { - if (state->fail.s_addr == state->interface->addr.s_addr && - state->state != STATE_PROBING) - { - up = uptime(); - if (state->defend + DEFEND_INTERVAL > up) { - drop_config(state, "FAIL", options); - state->conflicts = -1; - /* drop through to set conflicts to 0 */ - } else { - state->defend = up; - return 0; + if (state->fail.s_addr == state->interface->addr.s_addr) { + if (state->state == STATE_PROBING) + /* This should only happen when SIGALRM or + * link when down/up and we have a conflict. */ + drop_config(state, "EXPIRE", options); + else { + up = uptime(); + if (state->defend + DEFEND_INTERVAL > up) { + drop_config(state, "EXPIRE", options); + state->conflicts = -1; + /* drop through to set conflicts to 0 */ + } else { + state->defend = up; + return 0; + } } } do_socket(state, SOCKET_CLOSED);