From: Roy Marples Date: Thu, 17 Jul 2008 10:36:42 +0000 (+0000) Subject: Move the renew reset code futher down where it makes more sense. X-Git-Tag: v4.0.2~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33cb9a0ad156f0323ee6a0b724ce69b82c3da47f;p=thirdparty%2Fdhcpcd.git Move the renew reset code futher down where it makes more sense. --- diff --git a/client.c b/client.c index 2a941cdc..4d62c382 100644 --- a/client.c +++ b/client.c @@ -1170,15 +1170,9 @@ handle_timeout(struct if_state *state, const struct options *options) timerclear(&tv); switch (state->state) { - case STATE_RENEW_REQUESTED: - /* If a renew was requested (ie, didn't timeout) - * we need to remove the server address so we enter the - * INIT-REBOOT state correctly. */ - lease->server.s_addr = 0; - state->messages = 0; - /* FALLTHROUGH */ case STATE_INIT: /* FALLTHROUGH */ - case STATE_BOUND: + case STATE_BOUND: /* FALLTHROUGH */ + case STATE_RENEW_REQUESTED: up_interface(iface->name); do_socket(state, SOCKET_OPEN); state->xid = arc4random(); @@ -1214,6 +1208,12 @@ handle_timeout(struct if_state *state, const struct options *options) } break; case STATE_RENEW_REQUESTED: + /* If a renew was requested (ie, didn't timeout) + * we need to remove the server address so we enter the + * INIT-REBOOT state correctly. */ + lease->server.s_addr = 0; + state->messages = 0; +#ifdef ENABLE_IPV4LL if (IN_LINKLOCAL(ntohl(lease->addr.s_addr))) { state->state = STATE_PROBING; free(state->offer); @@ -1223,8 +1223,10 @@ handle_timeout(struct if_state *state, const struct options *options) timerclear(&state->timeout); return 0; } +#endif if (lease->addr.s_addr) { - logger(LOG_INFO, "renewing lease of %s",inet_ntoa(lease->addr)); + logger(LOG_INFO, "renewing lease of %s", + inet_ntoa(lease->addr)); state->state = STATE_RENEWING; tv.tv_sec = options->timeout; timeradd(&state->start, &tv, &state->stop);