From: Roy Marples Date: Thu, 12 Dec 2013 16:25:58 +0000 (+0000) Subject: Fix NAK backoff when a server NAKs a REQUEST after a DISCOVER. X-Git-Tag: v6.2.0~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a16ee92ac47929034d50d3da24879671fc774b8b;p=thirdparty%2Fdhcpcd.git Fix NAK backoff when a server NAKs a REQUEST after a DISCOVER. --- diff --git a/dhcp.c b/dhcp.c index 4c177969..ae778d7f 100644 --- 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) {