[dhcp] Pass PXE boot menu item to PXE Boot Server

Pick out the first boot menu item from the boot menu (option 43.9) and
pass it to the boot server as the boot menu item (option 43.71).

Also improve DHCP debug messages to include more details of the
packets being transmitted.
This commit is contained in:
Michael Brown
2009-01-23 01:13:50 +00:00
parent cf53998901
commit 76d05a4da0
3 changed files with 133 additions and 75 deletions

View File

@@ -108,11 +108,12 @@ static int copy_settings ( struct dhcp_packet *dest,
int create_fakedhcpdiscover ( struct net_device *netdev,
void *data, size_t max_len ) {
struct dhcp_packet dhcppkt;
struct in_addr ciaddr = { 0 };
struct in_addr dummy_addr = { 0 };
int rc;
if ( ( rc = dhcp_create_request ( &dhcppkt, netdev, ciaddr, NULL, data,
max_len ) ) != 0 ) {
if ( ( rc = dhcp_create_request ( &dhcppkt, netdev, DHCPDISCOVER,
dummy_addr, dummy_addr, dummy_addr,
NULL, data, max_len ) ) != 0 ) {
DBG ( "Could not create DHCPDISCOVER: %s\n",
strerror ( rc ) );
return rc;