Skip to content

Commit

Permalink
[dhcp] Don't consider invalid offers to be duplicates
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rwcr authored and mcb30 committed May 27, 2010
1 parent 2aad3fa commit 905ea56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net/udp/dhcp.c
Expand Up @@ -417,13 +417,13 @@ static void dhcp_rx_offer ( struct dhcp_session *dhcp,

/* Enqueue an offer to be filled in */
for ( i = 0 ; i < DHCP_MAX_OFFERS ; i++ ) {
if ( ! dhcp->offers[i].valid )
break;

if ( dhcp->offers[i].server.s_addr == server_id.s_addr ) {
DBGC ( dhcp, " dup\n" );
return;
}

if ( ! dhcp->offers[i].valid )
break;
}
if ( i == DHCP_MAX_OFFERS ) {
DBGC ( dhcp, " dropped\n" );
Expand Down

0 comments on commit 905ea56

Please sign in to comment.