mirror of https://github.com/ipxe/ipxe.git
[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>pull/1/head
parent
2aad3fab23
commit
905ea56753
|
@ -417,13 +417,13 @@ static void dhcp_rx_offer ( struct dhcp_session *dhcp,
|
||||||
|
|
||||||
/* Enqueue an offer to be filled in */
|
/* Enqueue an offer to be filled in */
|
||||||
for ( i = 0 ; i < DHCP_MAX_OFFERS ; i++ ) {
|
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 ) {
|
if ( dhcp->offers[i].server.s_addr == server_id.s_addr ) {
|
||||||
DBGC ( dhcp, " dup\n" );
|
DBGC ( dhcp, " dup\n" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! dhcp->offers[i].valid )
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if ( i == DHCP_MAX_OFFERS ) {
|
if ( i == DHCP_MAX_OFFERS ) {
|
||||||
DBGC ( dhcp, " dropped\n" );
|
DBGC ( dhcp, " dropped\n" );
|
||||||
|
|
Loading…
Reference in New Issue