diff options
| author | Michael Brown | 2007-11-21 04:29:53 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-11-21 04:29:53 +0100 |
| commit | 26f3a09ccf99244fffc4aad23b7bda78c3d9dd21 (patch) | |
| tree | 5c41bfc37056a01a8ee0baf68ab9627dd263fb62 /src/net/udp | |
| parent | Added definition of a UUID and uuid_ntoa() (for debugging), and (diff) | |
| download | ipxe-26f3a09ccf99244fffc4aad23b7bda78c3d9dd21.tar.gz ipxe-26f3a09ccf99244fffc4aad23b7bda78c3d9dd21.tar.xz ipxe-26f3a09ccf99244fffc4aad23b7bda78c3d9dd21.zip | |
Add UUID to DHCP request as option 97 (if available).
Diffstat (limited to 'src/net/udp')
| -rw-r--r-- | src/net/udp/dhcp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 8e34ccb6c..8504d8988 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -31,6 +31,7 @@ #include <gpxe/retry.h> #include <gpxe/tcpip.h> #include <gpxe/ip.h> +#include <gpxe/uuid.h> #include <gpxe/dhcp.h> /** @file @@ -529,6 +530,7 @@ int create_dhcp_request ( struct net_device *netdev, int msgtype, struct device_description *desc = &netdev->dev->desc; struct dhcp_netdev_desc dhcp_desc; struct dhcp_client_id client_id; + union uuid uuid; size_t dhcp_features_len; size_t ll_addr_len; int rc; @@ -604,6 +606,17 @@ int create_dhcp_request ( struct net_device *netdev, int msgtype, return rc; } + /* Add client UUID, if we have one. Required for PXE. */ + if ( ( rc = get_uuid ( &uuid ) ) == 0 ) { + if ( ( rc = set_dhcp_packet_option ( dhcppkt, + DHCP_CLIENT_UUID, &uuid, + sizeof ( uuid ) ) ) !=0){ + DBG ( "DHCP could not set client UUID: %s\n", + strerror ( rc ) ); + return rc; + } + } + return 0; } |
