Browse Source

[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>
tags/v1.0.0-rc1
Joshua Oreman 15 years ago
parent
commit
67015d1011
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/net/udp/dhcp.c

+ 2
- 2
src/net/udp/dhcp.c View File

@@ -693,7 +693,7 @@ static int dhcp_pxebs_tx ( struct dhcp_session *dhcp,
693 693
 
694 694
 	DBGC ( dhcp, "DHCP %p PXEBS REQUEST to %s:%d for type %d\n",
695 695
 	       dhcp, inet_ntoa ( peer->sin_addr ), ntohs ( peer->sin_port ),
696
-	       ntohs ( dhcp->pxe_type ) );
696
+	       le16_to_cpu ( dhcp->pxe_type ) );
697 697
 
698 698
 	/* Set boot menu item */
699 699
 	menu_item.type = dhcp->pxe_type;
@@ -1363,7 +1363,7 @@ int start_pxebs ( struct job_interface *job, struct net_device *netdev,
1363 1363
 	fetch_ipv4_setting ( netdev_settings ( netdev ), &ip_setting,
1364 1364
 			     &dhcp->local.sin_addr );
1365 1365
 	dhcp->local.sin_port = htons ( BOOTPC_PORT );
1366
-	dhcp->pxe_type = htons ( pxe_type );
1366
+	dhcp->pxe_type = cpu_to_le16 ( pxe_type );
1367 1367
 	dhcp->timer.expired = dhcp_timer_expired;
1368 1368
 
1369 1369
 	/* Construct PXE boot server IP address lists */

Loading…
Cancel
Save