aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-06-08 15:30:22 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-06-08 15:30:22 -0700
commite710751ff60647432123dbfe823f9692b8669765 (patch)
treef21d440547eb7746b85b9640cb618f526a8863df
parent16d1a84d79dbccd361397182725bff7516ac65d6 (diff)
downloadsyslinux-elf-e710751ff60647432123dbfe823f9692b8669765.tar.gz
syslinux-elf-e710751ff60647432123dbfe823f9692b8669765.tar.xz
syslinux-elf-e710751ff60647432123dbfe823f9692b8669765.zip
Capture the UUID from packet 1 (request)syslinux-3.50-pre22
Make sure we capture only the first instance of the UUID, in case the server does something silly like send back its own UUID.
-rw-r--r--pxelinux.asm15
1 files changed, 8 insertions, 7 deletions
diff --git a/pxelinux.asm b/pxelinux.asm
index 8003f895..ef4bf50d 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -231,8 +231,10 @@ MAC resb MAC_MAX+1 ; Actual MAC address
BOOTIFStr resb 7 ; Space for "BOOTIF="
MACStr resb 3*(MAC_MAX+1) ; MAC address as a string
-; One byte extra since dhcp_copyoption zero-terminates
-UUID resb 16+1 ; UUID, from the PXE stack
+; The relative position of these fields matter!
+UUIDType resb 1 ; Type byte from DHCP option
+UUID resb 16 ; UUID, from the PXE stack
+UUIDNull resb 1 ; dhcp_copyoption zero-terminates
;
; PXE packets which don't need static initialization
@@ -2279,12 +2281,11 @@ dopt_%2:
dopt 97, uuid_client_identifier
cmp ax,17 ; type byte + 16 bytes UUID
jne .skip
- cmp [si],ah ; type 0 == UUID
- jne .skip
- inc si
- dec ax
+ mov dl,[si] ; Must have type 0 == UUID
+ or dl,[HaveUUID] ; Capture only the first instance
+ jnz .skip
mov byte [HaveUUID],1 ; Got UUID
- mov di,UUID
+ mov di,UUIDType
jmp dhcp_copyoption
.skip: ret