]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix NAK backoff when a server NAKs a REQUEST after a DISCOVER.
authorRoy Marples <roy@marples.name>
Thu, 12 Dec 2013 16:25:58 +0000 (16:25 +0000)
committerRoy Marples <roy@marples.name>
Thu, 12 Dec 2013 16:25:58 +0000 (16:25 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 4c177969228ebc38c5363f7d36dc2cf060634ea7..ae778d7f4f1828487840e7854bd06d31108b10d1 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -2126,9 +2126,6 @@ dhcp_handledhcp(struct interface *iface, struct dhcp_message **dhcpp,
                return;
        }
 
-       /* No NAK, so reset the backoff */
-       state->nakoff = 0;
-
        if ((type == 0 || type == DHCP_OFFER) &&
            state->state == DHS_DISCOVER)
        {
@@ -2185,6 +2182,12 @@ dhcp_handledhcp(struct interface *iface, struct dhcp_message **dhcpp,
                    ifo->options &= ~DHCPCD_STATIC;
        }
 
+
+       /* No NAK, so reset the backoff
+        * We don't reset on an OFFER message because the server could
+        * potentially NAK the REQUEST. */
+       state->nakoff = 0;
+
        /* BOOTP could have already assigned this above, so check we still
         * have a pointer. */
        if (*dhcpp) {