summaryrefslogtreecommitdiffstats
path: root/src/usr/pxemenu.c
diff options
context:
space:
mode:
authorJoshua Oreman2009-11-20 04:20:17 +0100
committerMarty Connor2009-11-21 01:46:31 +0100
commit7a5aaecda2b37653b6f3debe25ff4cf03cb0d4d4 (patch)
tree0ef0f7268d784943668182494718a500eb29134c /src/usr/pxemenu.c
parent[int13] Guard against BIOSes that "fix" the drive count (diff)
downloadipxe-7a5aaecda2b37653b6f3debe25ff4cf03cb0d4d4.tar.gz
ipxe-7a5aaecda2b37653b6f3debe25ff4cf03cb0d4d4.tar.xz
ipxe-7a5aaecda2b37653b6f3debe25ff4cf03cb0d4d4.zip
[pxebs] Consistently interpret PXE type field as little-endian
The PXE menu code also treated the type as big-endian, which went unnoticed until the first fix because its ntohs() was matched by a htons() in the PXE boot server discovery code. Signed-off-by: Marty Connor <mdc@etherboot.org>
Diffstat (limited to 'src/usr/pxemenu.c')
-rw-r--r--src/usr/pxemenu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usr/pxemenu.c b/src/usr/pxemenu.c
index a778a126..519c200e 100644
--- a/src/usr/pxemenu.c
+++ b/src/usr/pxemenu.c
@@ -153,7 +153,7 @@ static int pxe_menu_parse ( struct pxe_menu **menu ) {
( num_menu_items * sizeof ( (*menu)->items[0] ) ) );
memcpy ( raw_menu_item, raw_menu, raw_menu_len );
for ( i = 0 ; i < num_menu_items ; i++ ) {
- (*menu)->items[i].type = ntohs ( raw_menu_item->type );
+ (*menu)->items[i].type = le16_to_cpu ( raw_menu_item->type );
(*menu)->items[i].desc = raw_menu_item->desc;
/* Set type to 0; this ensures that the description
* for the previous menu item is NUL-terminated.