]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When we get an ACK we should close DHCP sockets so we don't handle any NAKs
authorRoy Marples <roy@marples.name>
Fri, 18 Sep 2009 19:55:02 +0000 (19:55 +0000)
committerRoy Marples <roy@marples.name>
Fri, 18 Sep 2009 19:55:02 +0000 (19:55 +0000)
during ARP testing.

This is important as some broken DHCP servers NAK immediately after an ACK
in some situations.

client.c

index 55d7c8b9ba305ccfcb084127f3b7f67c0545f67d..90657b33e50b5a566f8d09a1f96db58da87f8cd8 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1500,6 +1500,7 @@ handle_dhcp(struct if_state *state, struct dhcp_message **dhcpp,
        }
 
        lease->frominfo = 0;
+       do_socket(state, SOCKET_CLOSED);
        if (state->options & DHCPCD_ARP &&
            iface->addr.s_addr != state->offer->yiaddr)
        {
@@ -1516,7 +1517,6 @@ handle_dhcp(struct if_state *state, struct dhcp_message **dhcpp,
                }
        }
 
-       do_socket(state, SOCKET_CLOSED);
        r = bind_dhcp(state, options);
        if (!(state->options & DHCPCD_ARP)) {
                if (!(state->options & DHCPCD_INFORM))