PXELINUX: if siaddr isn't set, fall back to server identity syslinux-3.52-pre2
authorH. Peter Anvin <hpa@zytor.com>
Fri, 29 Jun 2007 16:37:41 +0000 (12:37 -0400)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 29 Jun 2007 16:37:41 +0000 (12:37 -0400)
If the siaddr field in the DHCP header isn't set, fall back to the
server identity option.  This seems to match the behaviour of the PXE
stacks, and some (braindead) DHCP servers don't allow the server
identity to be set.

NEWS
pxelinux.asm

diff --git a/NEWS b/NEWS
index 1b606c1..ef79119 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,9 +6,13 @@ Changes in 3.52:
        * Handle capitalized F-key commands in the menu system.
        * Fix padding error when loading multiple ramdisks.
        * Workaround for VMware crashing when trying to print a
-         message during early kernel boot.
+         message during early kernel boot (does not seem to work,
+         consider deleting.)
        * chain.c32: add the ability to search for a specific MBR
          signature at runtime.
+       * Fall back to the server identity option if the siaddr field
+         in the DHCP header isn't set.  This seems to match the
+         behaviour of most PXE stacks.
 
 Changes in 3.51:
        * EXTLINUX: Fix failure to find the configuration file.
index b90a48b..800c66d 100644 (file)
@@ -2236,6 +2236,15 @@ dopt_%2:
                mov [OverLoad],bl
                ret
 
+       dopt 54, server
+               mov eax,[si]
+               cmp dword [ServerIP],0
+               jne .skip               ; Already have a next server IP
+               cmp al,224              ; Class D or higher
+               jae .skip
+               mov [ServerIP],eax
+.skip:         ret
+
        dopt 61, client_identifier
                cmp ax,MAC_MAX          ; Too long?
                ja .skip