changeset 2201:e3eb0a69b1db draft

Fix NAK backoff when a server NAKs a REQUEST after a DISCOVER.
author Roy Marples <roy@marples.name>
date Thu, 12 Dec 2013 16:25:58 +0000
parents bdc70c92e7a1
children 2a43815d2098
files dhcp.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dhcp.c	Thu Dec 12 13:33:09 2013 +0000
+++ b/dhcp.c	Thu Dec 12 16:25:58 2013 +0000
@@ -2126,9 +2126,6 @@
 		return;
 	}
 
-	/* No NAK, so reset the backoff */
-	state->nakoff = 0;
-
 	if ((type == 0 || type == DHCP_OFFER) &&
 	    state->state == DHS_DISCOVER)
 	{
@@ -2185,6 +2182,12 @@
 		    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) {