From: Roy Marples Date: Wed, 18 Jun 2008 09:05:04 +0000 (+0000) Subject: De-configure when rebinding fails. X-Git-Tag: v4.0.2~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4573309ce8651dfcf8706027aa9db0003e87d64e;p=thirdparty%2Fdhcpcd.git De-configure when rebinding fails. --- diff --git a/client.c b/client.c index fe041e3e..25a412ad 100644 --- a/client.c +++ b/client.c @@ -959,10 +959,7 @@ handle_timeout_fail(struct if_state *state, const struct options *options) if (gotlease == 0) return bind_dhcp(state, options); - if (state->new && !IN_LINKLOCAL(state->new->yiaddr)) - reason = "EXPIRE"; - else - reason = "FAIL"; + reason = "FAIL"; drop_config(state, reason, options); if (!(state->options & DHCPCD_DAEMONISED)) return -1; @@ -975,6 +972,8 @@ handle_timeout_fail(struct if_state *state, const struct options *options) break; case STATE_REBINDING: logger(LOG_ERR, "failed to rebind, attempting to discover"); + reason = "EXPIRE"; + drop_config(state, reason, options); state->state = STATE_INIT; break; default: @@ -983,8 +982,7 @@ handle_timeout_fail(struct if_state *state, const struct options *options) } get_time(&state->start); - tv.tv_usec = 0; - if (tv.tv_sec != 0) + if (timerisset(&tv)) timeradd(&state->start, &tv, &state->stop); /* This effectively falls through into the handle_timeout funtion */