summaryrefslogtreecommitdiffstats
path: root/src/net/udp/dhcp.c
diff options
context:
space:
mode:
authorMichael Brown2006-07-17 15:07:14 +0200
committerMichael Brown2006-07-17 15:07:14 +0200
commit6c01d3bb95c8dfbbbc3f2b4fb36fce6bd2f3e952 (patch)
treea43152f027ef99025063ac818393e45ea8480629 /src/net/udp/dhcp.c
parentTidy up hex_dump() output. (diff)
downloadipxe-6c01d3bb95c8dfbbbc3f2b4fb36fce6bd2f3e952.tar.gz
ipxe-6c01d3bb95c8dfbbbc3f2b4fb36fce6bd2f3e952.tar.xz
ipxe-6c01d3bb95c8dfbbbc3f2b4fb36fce6bd2f3e952.zip
Fix creation of the htype field; the ll_proto field from which it is
derived is a 16-bit big-endian field, but htype is only 8 bits wide.
Diffstat (limited to 'src/net/udp/dhcp.c')
-rw-r--r--src/net/udp/dhcp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c
index 1523e404..7e9af09f 100644
--- a/src/net/udp/dhcp.c
+++ b/src/net/udp/dhcp.c
@@ -29,11 +29,6 @@
*
*/
-struct dhcp_session {
- struct net_device *netdev;
- uint32_t xid;
-};
-
/** DHCP operation types
*
* This table maps from DHCP message types (i.e. values of the @c
@@ -186,7 +181,7 @@ size_t dhcp_assemble ( struct dhcp_session *dhcp, void *data,
dhcppkt->op = dhcp_op[dhcp_message_type];
/* Fill in NIC details */
- dhcppkt->htype = dhcp->netdev->ll_protocol->ll_proto;
+ dhcppkt->htype = ntohs ( dhcp->netdev->ll_protocol->ll_proto );
dhcppkt->hlen = dhcp->netdev->ll_protocol->ll_addr_len;
memcpy ( dhcppkt->chaddr, dhcp->netdev->ll_addr, dhcppkt->hlen );