Centralise construction of the DHCP request and response packets.

This commit is contained in:
Michael Brown
2007-07-31 03:02:21 +01:00
parent d0abffc2f6
commit 5e26df0325
4 changed files with 126 additions and 60 deletions

View File

@@ -397,16 +397,13 @@ static int nbi_prepare_dhcp ( struct image *image ) {
return -ENODEV;
}
if ( ( rc = create_dhcp_packet ( boot_netdev, DHCPACK, basemem_packet,
sizeof ( basemem_packet ),
&dhcppkt ) ) != 0 ) {
if ( ( rc = create_dhcp_response ( boot_netdev, DHCPACK, NULL,
basemem_packet,
sizeof ( basemem_packet ),
&dhcppkt ) ) != 0 ) {
DBGC ( image, "NBI %p failed to build DHCP packet\n", image );
return rc;
}
if ( ( rc = copy_dhcp_packet_options ( &dhcppkt, NULL ) ) != 0 ) {
DBGC ( image, "NBI %p failed to copy DHCP options\n", image );
return rc;
}
return 0;
}