mirror of
https://github.com/ipxe/ipxe
synced 2025-12-15 17:12:54 +03:00
[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>
This commit is contained in:
committed by
Marty Connor
parent
b515977955
commit
7a5aaecda2
@@ -153,7 +153,7 @@ static int pxe_menu_parse ( struct pxe_menu **menu ) {
|
|||||||
( num_menu_items * sizeof ( (*menu)->items[0] ) ) );
|
( num_menu_items * sizeof ( (*menu)->items[0] ) ) );
|
||||||
memcpy ( raw_menu_item, raw_menu, raw_menu_len );
|
memcpy ( raw_menu_item, raw_menu, raw_menu_len );
|
||||||
for ( i = 0 ; i < num_menu_items ; i++ ) {
|
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;
|
(*menu)->items[i].desc = raw_menu_item->desc;
|
||||||
/* Set type to 0; this ensures that the description
|
/* Set type to 0; this ensures that the description
|
||||||
* for the previous menu item is NUL-terminated.
|
* for the previous menu item is NUL-terminated.
|
||||||
|
|||||||
Reference in New Issue
Block a user