summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Oreman2009-10-19 00:59:19 +0200
committerMichael Brown2009-10-24 20:34:35 +0200
commit67015d10116d259d835f3be4611a8cba2f069e96 (patch)
treeb83f8a0d966f911d1763e098fb9d112816c0827f
parent[atl1e] Fix compilation on gcc-4.4.1-2.fc11.i586. (diff)
downloadipxe-67015d10116d259d835f3be4611a8cba2f069e96.tar.gz
ipxe-67015d10116d259d835f3be4611a8cba2f069e96.tar.xz
ipxe-67015d10116d259d835f3be4611a8cba2f069e96.zip
[pxebs] Correct endianness of PXE type
The PXE type field is canonically little-endian, but the pxebs command treats it as big-endian in converting the type number passed on the command line to a field value to search against. Fix, to prevent the necessity of incantations like "pxebs net0 1536" to select menu item #6. Signed-off-by: Michael Brown <mcb30@etherboot.org> Modified-by: Michael Brown <mcb30@etherboot.org>
-rw-r--r--src/net/udp/dhcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c
index 5f741377..2483ec29 100644
--- a/src/net/udp/dhcp.c
+++ b/src/net/udp/dhcp.c
@@ -693,7 +693,7 @@ static int dhcp_pxebs_tx ( struct dhcp_session *dhcp,
DBGC ( dhcp, "DHCP %p PXEBS REQUEST to %s:%d for type %d\n",
dhcp, inet_ntoa ( peer->sin_addr ), ntohs ( peer->sin_port ),
- ntohs ( dhcp->pxe_type ) );
+ le16_to_cpu ( dhcp->pxe_type ) );
/* Set boot menu item */
menu_item.type = dhcp->pxe_type;
@@ -1363,7 +1363,7 @@ int start_pxebs ( struct job_interface *job, struct net_device *netdev,
fetch_ipv4_setting ( netdev_settings ( netdev ), &ip_setting,
&dhcp->local.sin_addr );
dhcp->local.sin_port = htons ( BOOTPC_PORT );
- dhcp->pxe_type = htons ( pxe_type );
+ dhcp->pxe_type = cpu_to_le16 ( pxe_type );
dhcp->timer.expired = dhcp_timer_expired;
/* Construct PXE boot server IP address lists */