diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-03-26 15:21:31 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-03-26 15:21:31 -0700 |
commit | 0a97c5dafe5330ff29b6a41b2b25628da6b73e77 (patch) | |
tree | 1b09697359d6247b1e8ea0901fe25104995300bb | |
parent | ed70ab271905bfe455ac79edd2813480664ee73f (diff) | |
download | syslinux-elf-0a97c5dafe5330ff29b6a41b2b25628da6b73e77.tar.gz syslinux-elf-0a97c5dafe5330ff29b6a41b2b25628da6b73e77.tar.xz syslinux-elf-0a97c5dafe5330ff29b6a41b2b25628da6b73e77.zip |
PXELINUX: When doing a gPXE FILE_READ, actually handle errors
If gPXE FILE_READ returns an actual error, don't loop forever.
-rw-r--r-- | pxelinux.asm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pxelinux.asm b/pxelinux.asm index 6a57966d..b3f1cbb8 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -2019,15 +2019,17 @@ get_packet_gpxe: mov word [di+4],PKTBUF_SIZE mov bx,PXENV_FILE_READ call pxenv - ; XXX: FIX THIS: Need to be able to distinguish - ; error, EOF, and no data - jc .again + jnc .ok ; Got data or EOF + cmp word [di],PXENV_STATUS_TFTP_OPEN ; == EWOULDBLOCK + je .again + jmp kaboom ; Otherwise error... +.ok: movzx eax,word [di+4] ; Bytes read mov [si+tftp_bytesleft],ax ; Bytes in buffer add [si+tftp_filepos],eax ; Position in file - and ax,ax + and ax,ax ; EOF? mov eax,[si+tftp_filepos] jnz .got_stuff |