Преглед на файлове

[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…
Отказ
Запис