瀏覽代碼

[dhcp] Don't consider invalid offers to be duplicates

This fixes a regression in BOOTP support; since BOOTP requests often
have the `siaddr' field set to 0.0.0.0, they would be considered
duplicates of the first zeroed-out offer slot.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Joshua Oreman 14 年之前
父節點
當前提交
905ea56753
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      src/net/udp/dhcp.c

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

@@ -417,13 +417,13 @@ static void dhcp_rx_offer ( struct dhcp_session *dhcp,
417 417
 
418 418
 	/* Enqueue an offer to be filled in */
419 419
 	for ( i = 0 ; i < DHCP_MAX_OFFERS ; i++ ) {
420
+		if ( ! dhcp->offers[i].valid )
421
+			break;
422
+
420 423
 		if ( dhcp->offers[i].server.s_addr == server_id.s_addr ) {
421 424
 			DBGC ( dhcp, " dup\n" );
422 425
 			return;
423 426
 		}
424
-
425
-		if ( ! dhcp->offers[i].valid )
426
-			break;
427 427
 	}
428 428
 	if ( i == DHCP_MAX_OFFERS ) {
429 429
 		DBGC ( dhcp, " dropped\n" );

Loading…
取消
儲存