[dhcp] Do not transition to DHCPREQUEST without a valid DHCPOFFER
authorMichael Brown <mcb30@etherboot.org>
Wed, 11 Jun 2008 05:20:49 +0000 (06:20 +0100)
committerMichael Brown <mcb30@etherboot.org>
Wed, 11 Jun 2008 05:20:49 +0000 (06:20 +0100)
A missing test for dhcp->dhcpoffer in dhcp_timer_expired() was causing
the client to transition to DHCPREQUEST after timing out on waiting
for ProxyDHCP even if no DHCPOFFERs had been received.

src/net/udp/dhcp.c

index 0ce3c19..6ff8afe 100644 (file)
@@ -932,7 +932,7 @@ static void dhcp_timer_expired ( struct retry_timer *timer, int fail ) {
        }
 
        /* Give up waiting for ProxyDHCP before we reach the failure point */
-       if ( elapsed > PROXYDHCP_WAIT_TIME ) {
+       if ( dhcp->dhcpoffer && ( elapsed > PROXYDHCP_WAIT_TIME ) ) {
                if ( dhcp->state == DHCP_STATE_DISCOVER ) {
                        dhcp_set_state ( dhcp, DHCP_STATE_REQUEST );
                        return;