From 8feb9b19ae0ab7c6f384e67aa8e757f327f3a7e8 Mon Sep 17 00:00:00 2001 From: hpa Date: Fri, 21 Nov 2003 08:56:49 +0000 Subject: [PATCH] Recognize pxelinux options in a vendor-option-space as well as a site-option-space. --- NEWS | 3 +++ pxelinux.asm | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/NEWS b/NEWS index 4c029c3..d80099e 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,9 @@ Changes in 2.07: * MEMDISK: Fix bug that would occationally cause "ran out of input data" when using compressed disk images. * SYSLINUX: Updates for the win32 installer (from Lars Munch.) + * PXELINUX: PXELINUX-specific options are now recognized both + in a vendor-option-space (a.k.a. type 43 encapsulated) as + well as in a site-option-space (unencapsulated.) Changes in 2.06: * ALL: Fix problem that would occationally cause a diff --git a/pxelinux.asm b/pxelinux.asm index fd0d62c..802118b 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -2116,7 +2116,14 @@ parse_dhcp: ; size is CX -- some DHCP servers leave option fields unterminated ; in violation of the spec. ; +; For parse_some_dhcp_options, DH contains the minimum value for +; the option to recognize -- this is used to restrict parsing to +; PXELINUX-specific options only. +; parse_dhcp_options: + xor dx,dx + +parse_some_dhcp_options: .loop: and cx,cx jz .done @@ -2137,6 +2144,9 @@ parse_dhcp_options: sub cx,ax ; Decrement bytes left counter jb .done ; Malformed option: length > field size + cmp dl,dh ; Is the option value + jb .opt_done + cmp dl,1 ; SUBNET MASK option jne .not_subnet mov edx,[si] @@ -2151,6 +2161,16 @@ parse_dhcp_options: jmp .opt_done .not_router: + cmp dl,43 ; VENDOR ENCAPSULATED option + jne .not_vendor + pusha + mov dh,208 ; Only recognize PXELINUX options + mov cx,ax ; Length of option = max bytes to parse + call parse_some_dhcp_options ; Parse recursive structure + popa + jmp .opt_done +.not_vendor: + cmp dl,52 ; OPTION OVERLOAD option jne .not_overload mov dl,[si] -- 2.7.4