]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[dhcp] Do not skip ProxyDHCPREQUEST if next-server is empty
authorMichael Brown <mcb30@ipxe.org>
Wed, 26 Aug 2015 15:02:46 +0000 (16:02 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 26 Aug 2015 15:08:58 +0000 (16:08 +0100)
We attempt to mimic the behaviour of Intel's PXE ROM by skipping the
separate ProxyDHCPREQUEST if the ProxyDHCPOFFER already contains a
boot filename or a PXE boot menu.

Experimentation reveals that Intel's PXE ROM will also check for a
non-empty next-server address alongside the boot filename.  Update our
test to match this behaviour.

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Tested-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/udp/dhcp.c

index aed5ee36051b32200d2c71038b9539850629f411..36c2b13a66a69784b862700b1dcaee44b5222b4a 100644 (file)
@@ -296,8 +296,9 @@ static void dhcp_set_state ( struct dhcp_session *dhcp,
  */
 static int dhcp_has_pxeopts ( struct dhcp_packet *dhcppkt ) {
 
-       /* Check for a boot filename */
-       if ( dhcppkt_fetch ( dhcppkt, DHCP_BOOTFILE_NAME, NULL, 0 ) > 0 )
+       /* Check for a next-server and boot filename */
+       if ( dhcppkt->dhcphdr->siaddr.s_addr &&
+            ( dhcppkt_fetch ( dhcppkt, DHCP_BOOTFILE_NAME, NULL, 0 ) > 0 ) )
                return 1;
 
        /* Check for a PXE boot menu */