[pxe] Always retrieve cached DHCPACK and apply to relevant network device

When chainloading, always retrieve the cached DHCPACK packet from the
underlying PXE stack, and apply it as the original contents of the
"net<X>.dhcp" settings block.  This allows cached DHCP settings to be
used for any chainloaded iPXE binary (not just undionly.kkpxe).

This change eliminates the undocumented "use-cached" setting.  Issuing
the "dhcp" command will now always result in a fresh DHCP request.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-10-25 17:24:09 +01:00
parent 1aa67eba16
commit 10d19bd2ac
7 changed files with 239 additions and 198 deletions

View File

@@ -51,12 +51,8 @@ int dhcp ( struct net_device *netdev ) {
/* Perform DHCP */
printf ( "DHCP (%s %s)", netdev->name,
netdev->ll_protocol->ntoa ( netdev->ll_addr ) );
if ( ( rc = start_dhcp ( &monojob, netdev ) ) == 0 ) {
if ( ( rc = start_dhcp ( &monojob, netdev ) ) == 0 )
rc = monojob_wait ( "" );
} else if ( rc > 0 ) {
printf ( " using cached\n" );
rc = 0;
}
return rc;
}