summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-06-09 10:49:31 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-06-09 10:49:31 -0700
commit78edf2be58fd9106af088b8a2b09fca1d41e1dfa (patch)
treedd59483bfaefe428f0794cb1e4f20ba795366b15
parent69bb4b204e8d29c89597961e94807d1acba2cd4b (diff)
parent38e1c74db64e02152e525c2d5c135cb5793d847e (diff)
downloadsyslinux-78edf2be58fd9106af088b8a2b09fca1d41e1dfa.tar.gz
Merge commit 'syslinux-3.82'
Conflicts: com32/menu/menumain.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--NEWS3
-rw-r--r--com32/menu/menumain.c5
-rw-r--r--core/diskstart.inc8
-rw-r--r--core/extlinux.asm4
-rw-r--r--core/pxelinux.asm34
5 files changed, 39 insertions, 15 deletions
diff --git a/NEWS b/NEWS
index 70563f72..5a18525b 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ Changes in 3.82:
* ISOLINUX: deal with systems which return from INT 13h with
interrupts disabled.
* Do not invoke the idle handler during large file loads.
+ * Simple menu: make ONTIMEOUT work with MENU HIDDEN.
+ * PXELINUX: handle TFTP servers which have extra NULs at the
+ end of an OACK packet.
Changes in 3.81:
* Shuffler: fix bug in real-mode entry. This affected a
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index b86e9b4d..82f0018c 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -724,7 +724,10 @@ static const char *do_hidden_menu(void)
}
}
- return cm->menu_entries[cm->defentry]->cmdline; /* Default entry */
+ if (cm->ontimeout)
+ return cm->ontimeout;
+ else
+ return cm->menu_entries[cm->defentry]->cmdline; /* Default entry */
}
static const char *run_menu(void)
diff --git a/core/diskstart.inc b/core/diskstart.inc
index c3881eab..53229223 100644
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -503,6 +503,7 @@ ldlinux_ent:
;
jmp 0:.next
.next:
+ sti ; In case of broken INT 13h BIOSes
;
; Tell the user we got this far
@@ -609,11 +610,16 @@ writestr_early:
ret
+;
; getlinsecsr: save registers, call getlinsec, restore registers
+; Save/restore the flags, too, especially IF.
;
-getlinsecsr: pushad
+getlinsecsr:
+ pushfd
+ pushad
call getlinsec
popad
+ popfd
ret
;
diff --git a/core/extlinux.asm b/core/extlinux.asm
index 46faac55..ac5fb6f0 100644
--- a/core/extlinux.asm
+++ b/core/extlinux.asm
@@ -116,7 +116,7 @@ Files resb MAX_OPEN*open_file_t_size
mov bx,SuperBlock
mov eax,1024 >> SECTOR_SHIFT
mov bp,ax
- call getlinsec
+ call getlinsecsr
;
; Compute some values...
@@ -208,7 +208,7 @@ getonesec_ext:
getlinsec_ext:
cmp eax,[SecPerClust]
- jae getlinsec ; Nothing fancy
+ jae getlinsecsr ; Nothing fancy
; If we get here, at least part of what we want is in the
; zero block. Zero one sector at a time and loop.
diff --git a/core/pxelinux.asm b/core/pxelinux.asm
index 9d9d5b4d..58201a0b 100644
--- a/core/pxelinux.asm
+++ b/core/pxelinux.asm
@@ -1105,7 +1105,17 @@ searchdir:
; SI -> first byte of options; [E]CX -> byte count
.parse_oack:
jcxz .done_pkt ; No options acked
+
.get_opt_name:
+ ; If we find an option which starts with a NUL byte,
+ ; (a null option), we're either seeing garbage that some
+ ; TFTP servers add to the end of the packet, or we have
+ ; no clue how to parse the rest of the packet (what is
+ ; an option name and what is a value?) In either case,
+ ; discard the rest.
+ cmp byte [si],0
+ je .done_pkt
+
mov di,si
mov bx,si
.opt_name_loop: lodsb
@@ -1115,10 +1125,10 @@ searchdir:
stosb
loop .opt_name_loop
; We ran out, and no final null
- jmp .err_reply
+ jmp .done_pkt ; Ignore runt option
.got_opt_name: ; si -> option value
dec cx ; bytes left in pkt
- jz .err_reply ; Option w/o value
+ jz .done_pkt ; Option w/o value, ignore
; Parse option pointed to by bx; guaranteed to be
; null-terminated.
@@ -1141,7 +1151,8 @@ searchdir:
pop si
pop cx
- jmp .err_reply ; Non-negotiated option returned
+ ; Non-negotiated option returned, no idea what it means...
+ jmp .err_reply
.get_value: pop si ; si -> option value
pop cx ; cx -> bytes left in pkt
@@ -1221,13 +1232,13 @@ searchdir:
pop es
jmp .done_pkt
-.err_reply: ; Option negotiation error. Send ERROR reply.
+.err_reply: ; TFTP protocol error. Send ERROR reply.
; ServerIP and gateway are already programmed in
mov si,[bp-6]
mov ax,[si+tftp_remoteport]
mov word [pxe_udp_write_pkt.rport],ax
- mov word [pxe_udp_write_pkt.buffer],tftp_opt_err
- mov word [pxe_udp_write_pkt.buffersize],tftp_opt_err_len
+ mov word [pxe_udp_write_pkt.buffer],tftp_proto_err
+ mov word [pxe_udp_write_pkt.buffersize],tftp_proto_err_len
mov di,pxe_udp_write_pkt
mov bx,PXENV_UDP_WRITE
call pxenv
@@ -2725,12 +2736,13 @@ tftp_opt_table:
tftp_opts equ ($-tftp_opt_table)/6
;
-; Error packet to return on options negotiation error
+; Error packet to return on TFTP protocol error
+; Most of our errors are OACK parsing errors, so use that error code
;
-tftp_opt_err dw TFTP_ERROR ; ERROR packet
- dw TFTP_EOPTNEG ; ERROR 8: bad options
- db 'tsize option required', 0 ; Error message
-tftp_opt_err_len equ ($-tftp_opt_err)
+tftp_proto_err dw TFTP_ERROR ; ERROR packet
+ dw TFTP_EOPTNEG ; ERROR 8: OACK error
+ db 'TFTP protocol error', 0 ; Error message
+tftp_proto_err_len equ ($-tftp_proto_err)
alignz 4
ack_packet_buf: dw TFTP_ACK, 0 ; TFTP ACK packet