diff options
| author | Michael Brown | 2013-03-20 01:54:42 +0100 |
|---|---|---|
| committer | Michael Brown | 2013-03-20 01:54:42 +0100 |
| commit | a9b63ecda55ea24df7d51d59cc7fd7b3234bc135 (patch) | |
| tree | 17e585def0f88c0f0f37f4ee0a057a34099925dc | |
| parent | [smbios] Mangle UUIDs for SMBIOS version 2.6 and newer (diff) | |
| download | ipxe-a9b63ecda55ea24df7d51d59cc7fd7b3234bc135.tar.gz ipxe-a9b63ecda55ea24df7d51d59cc7fd7b3234bc135.tar.xz ipxe-a9b63ecda55ea24df7d51d59cc7fd7b3234bc135.zip | |
[dhcp] Use PXE byte ordering for UUID in DHCP option 97
The PXE spec does not specify a byte ordering for UUIDs, but RFC4578
suggests that it follows the EFI spec, in which the first three fields
are little-endian.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
| -rw-r--r-- | src/net/udp/dhcp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index e63c3e422..3f2c451e1 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -1041,10 +1041,17 @@ int dhcp_create_request ( struct dhcp_packet *dhcppkt, return rc; } - /* Add client UUID, if we have one. Required for PXE. */ + /* Add client UUID, if we have one. Required for PXE. The + * PXE spec does not specify a byte ordering for UUIDs, but + * RFC4578 suggests that it follows the EFI spec, in which the + * first three fields are little-endian. + */ client_uuid.type = DHCP_CLIENT_UUID_TYPE; if ( ( len = fetch_uuid_setting ( NULL, &uuid_setting, &client_uuid.uuid ) ) >= 0 ) { + __bswap_32s ( &client_uuid.uuid.canonical.a ); + __bswap_16s ( &client_uuid.uuid.canonical.b ); + __bswap_16s ( &client_uuid.uuid.canonical.c ); if ( ( rc = dhcppkt_store ( dhcppkt, DHCP_CLIENT_UUID, &client_uuid, sizeof ( client_uuid ) ) ) != 0 ) { |
