]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Wait correctly after a DECLINE and ensure we send the IP we're declining and ServerID...
authorRoy Marples <roy@marples.name>
Tue, 28 Oct 2008 09:26:42 +0000 (09:26 +0000)
committerRoy Marples <roy@marples.name>
Tue, 28 Oct 2008 09:26:42 +0000 (09:26 +0000)
client.c

index 2787ae0f3e04f2ed4a02b8c3a54e99d8dac7766e..03a4ef76592d97a6f4c5f53a5269e4a83b0b77ce 100644 (file)
--- 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;
        }