aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2000-12-29 01:16:04 +0000
committerhpa <hpa>2000-12-29 01:16:04 +0000
commitfcf3a07de5c293b6bfbad6f2b0d45c9436dd988d (patch)
treea8defebd4f73662cd60b3cc3efae97e02fc7e11a
parent0f521d2df21e8a18c23717891c49022100a41cce (diff)
downloadsyslinux.git-fcf3a07de5c293b6bfbad6f2b0d45c9436dd988d.tar.gz
syslinux.git-fcf3a07de5c293b6bfbad6f2b0d45c9436dd988d.tar.xz
syslinux.git-fcf3a07de5c293b6bfbad6f2b0d45c9436dd988d.zip
If packet 2 doesn't contain a valid IP address, try packet 3 anyway...
-rw-r--r--pxelinux.asm28
1 files changed, 21 insertions, 7 deletions
diff --git a/pxelinux.asm b/pxelinux.asm
index 9f33e884..9926ee3b 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -548,15 +548,9 @@ query_bootp:
call crlf
.pxe_ok:
- mov si,myipaddr_msg
- call writestr
mov eax,[trackbuf+bootp.yip] ; "Your" IP address
mov [MyIP],eax
- xchg ah,al ; Host byte order
- ror eax,16
- xchg ah,al
- call writehex8
- call crlf
+
;
; Now, get the boot file and other info. This lives in the CACHED_REPLY
; packet (query info 3).
@@ -578,6 +572,26 @@ query_bootp:
rep movsd ; Copy bootfile name
;
+; If packet 2 didn't contain a valid IP address, guess that it's in this
+; packet instead
+;
+ mov si,myipaddr_msg
+ call writestr
+ mov eax,[MyIP]
+ cmp eax, byte 0 ; 0.0.0.0 bad
+ je .badip
+ cmp al,224 ; 224..255.x.x.x
+ jb .goodip
+.badip:
+ mov eax,[trackbuf+bootp.yip] ; Hope this is better...
+ mov [MyIP],eax
+.goodip:
+ xchg ah,al ; Host byte order
+ ror eax,16
+ xchg ah,al
+ call writehex8
+ call crlf
+;
; Normalize ES = DS
;
mov ax,ds