[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

@@ -397,14 +397,7 @@ struct dhcp_netdev_desc {
uint16_t device;
} __attribute__ (( packed ));
/** Use cached network settings
*
* Cached network settings may be available from a prior DHCP request
* (if running as a PXE NBP), non-volatile storage on the NIC, or
* settings set via the command line or an embedded image. If this
* flag is not set, it will be assumed that those sources are
* insufficient and that DHCP should still be run when autobooting.
*/
/** Use cached network settings (obsolete; do not reuse this value) */
#define DHCP_EB_USE_CACHED DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xb2 )
/** BIOS drive number
@@ -677,12 +670,4 @@ extern int start_dhcp ( struct interface *job, struct net_device *netdev );
extern int start_pxebs ( struct interface *job, struct net_device *netdev,
unsigned int pxe_type );
/* In environments that can provide cached DHCP packets, this function
* should look for such a packet and call store_cached_dhcpack() with
* it if it exists.
*/
extern void get_cached_dhcpack ( void );
extern void store_cached_dhcpack ( userptr_t data, size_t len );
#endif /* _IPXE_DHCP_H */