Browse Source

[dhcp] Do not transition to DHCPREQUEST without a valid DHCPOFFER

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.
tags/v0.9.4
Michael Brown 16 years ago
parent
commit
3a2c8a2690
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/udp/dhcp.c

+ 1
- 1
src/net/udp/dhcp.c View File

@@ -932,7 +932,7 @@ static void dhcp_timer_expired ( struct retry_timer *timer, int fail ) {
932 932
 	}
933 933
 
934 934
 	/* Give up waiting for ProxyDHCP before we reach the failure point */
935
-	if ( elapsed > PROXYDHCP_WAIT_TIME ) {
935
+	if ( dhcp->dhcpoffer && ( elapsed > PROXYDHCP_WAIT_TIME ) ) {
936 936
 		if ( dhcp->state == DHCP_STATE_DISCOVER ) {
937 937
 			dhcp_set_state ( dhcp, DHCP_STATE_REQUEST );
938 938
 			return;

Loading…
Cancel
Save