Browse Source

[DHCP] Fix RFC4390 client identifier constructions.

RFC 4390 provides for the DHCP client identifier to contain the link-layer
hardware type and MAC address when the MAC address exceeds 16 bytes.
However, the hardware type field is only 8 bits; we were assuming 16 bits.
tags/v0.9.4
Michael Brown 16 years ago
parent
commit
844828cb15
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/udp/dhcp.c

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

610
 	/* Add DHCP client identifier.  Required for Infiniband, and
610
 	/* Add DHCP client identifier.  Required for Infiniband, and
611
 	 * doesn't hurt other link layers.
611
 	 * doesn't hurt other link layers.
612
 	 */
612
 	 */
613
-	client_id.ll_proto = netdev->ll_protocol->ll_proto;
613
+	client_id.ll_proto = ntohs ( netdev->ll_protocol->ll_proto );
614
 	ll_addr_len = netdev->ll_protocol->ll_addr_len;
614
 	ll_addr_len = netdev->ll_protocol->ll_addr_len;
615
 	assert ( ll_addr_len <= sizeof ( client_id.ll_addr ) );
615
 	assert ( ll_addr_len <= sizeof ( client_id.ll_addr ) );
616
 	memcpy ( client_id.ll_addr, netdev->ll_addr, ll_addr_len );
616
 	memcpy ( client_id.ll_addr, netdev->ll_addr, ll_addr_len );

Loading…
Cancel
Save