summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoshua Oreman2010-05-26 23:22:03 +0200
committerMichael Brown2010-05-27 11:22:05 +0200
commit905ea567534bbb67b83b2be41bfcd42209681e6a (patch)
tree3b0147190d2b983692551c734379e96b6e6069b6 /src
parent[build] Use weak definitions instead of weak declarations (diff)
downloadipxe-905ea567534bbb67b83b2be41bfcd42209681e6a.tar.gz
ipxe-905ea567534bbb67b83b2be41bfcd42209681e6a.tar.xz
ipxe-905ea567534bbb67b83b2be41bfcd42209681e6a.zip
[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>
Diffstat (limited to 'src')
-rw-r--r--src/net/udp/dhcp.c6
1 files changed, 3 insertions, 3 deletions
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" );