From: Roy Marples Date: Tue, 28 Oct 2008 09:26:42 +0000 (+0000) Subject: Wait correctly after a DECLINE and ensure we send the IP we're declining and ServerID... X-Git-Tag: v4.0.3~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c96d2538cddf54f633dcd46ceb0644178789c645;p=thirdparty%2Fdhcpcd.git Wait correctly after a DECLINE and ensure we send the IP we're declining and ServerID that issued it. --- diff --git a/client.c b/client.c index 2787ae0f..03a4ef76 100644 --- a/client.c +++ b/client.c @@ -1666,17 +1666,19 @@ handle_arp_fail(struct if_state *state, const struct options *options) int cookie = state->offer->cookie; if (!IN_LINKLOCAL(htonl(state->fail.s_addr))) { + if (cookie) { + state->timeout.tv_sec = DHCP_ARP_FAIL; + state->timeout.tv_usec = 0; + do_socket(state, SOCKET_OPEN); + send_message(state, DHCP_DECLINE, options); + do_socket(state, SOCKET_CLOSED); + } state->state = STATE_INIT; free(state->offer); state->offer = NULL; state->lease.addr.s_addr = 0; if (!cookie) return 1; - state->timeout.tv_sec = DHCP_ARP_FAIL; - state->timeout.tv_usec = 0; - do_socket(state, SOCKET_OPEN); - send_message(state, DHCP_DECLINE, options); - do_socket(state, SOCKET_CLOSED); return 0; }