mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 18:12:36 +03:00
[DHCP] Fix up fake-packet creation as used by PXENV_GET_CACHED_INFO
Add dedicated functions create_dhcpdiscover(), create_dhcpack() and create_proxydhcpack() for use by external code such as the PXE preboot code. Register ProxyDHCP options under the global scope "proxydhcp". Unregister previously-acquired DHCP and ProxyDHCP settings when DHCP succeeds.
This commit is contained in:
@@ -33,18 +33,12 @@
|
||||
*/
|
||||
|
||||
int dhcp ( struct net_device *netdev ) {
|
||||
struct settings *settings;
|
||||
int rc;
|
||||
|
||||
/* Check we can open the interface first */
|
||||
if ( ( rc = ifopen ( netdev ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* Unregister any option blocks acquired via DHCP */
|
||||
settings = find_child_settings ( netdev_settings ( netdev ), "dhcp" );
|
||||
if ( settings )
|
||||
unregister_settings ( settings );
|
||||
|
||||
/* Perform DHCP */
|
||||
printf ( "DHCP (%s %s)", netdev->name, netdev_hwaddr ( netdev ) );
|
||||
if ( ( rc = start_dhcp ( &monojob, netdev ) ) == 0 )
|
||||
|
||||
Reference in New Issue
Block a user