From: Joshua Oreman Date: Wed, 26 May 2010 21:22:03 +0000 (-0700) Subject: [dhcp] Don't consider invalid offers to be duplicates X-Git-Tag: v1.20.1~2675 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=905ea567534bbb67b83b2be41bfcd42209681e6a;p=thirdparty%2Fipxe.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 Signed-off-by: Michael Brown --- diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 7850fb4b8..a092a27ef 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -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" );