瀏覽代碼

[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 年之前
父節點
當前提交
3a2c8a2690
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      src/net/udp/dhcp.c

+ 1
- 1
src/net/udp/dhcp.c 查看文件

@@ -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…
取消
儲存