summaryrefslogtreecommitdiff
path: root/src/net/udp/dhcp.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2013-10-25 17:24:09 +0100
committerMichael Brown <mcb30@ipxe.org>2013-10-25 17:29:25 +0100
commit10d19bd2ac302cd5237e7b1ca200760594a3c8c2 (patch)
tree8759bfa0d517e82eeec8ca3829f56cd291465fda /src/net/udp/dhcp.c
parent1aa67eba161f0e1410d8028bd60ee6778ebfa977 (diff)
downloadqemu-ipxe-10d19bd2ac302cd5237e7b1ca200760594a3c8c2.tar.gz
[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>
Diffstat (limited to 'src/net/udp/dhcp.c')
-rw-r--r--src/net/udp/dhcp.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c
index 762ae732..be03096b 100644
--- a/src/net/udp/dhcp.c
+++ b/src/net/udp/dhcp.c
@@ -107,14 +107,6 @@ struct setting user_class_setting __setting ( SETTING_HOST_EXTRA ) = {
.type = &setting_type_string,
};
-/** Use cached network settings */
-struct setting use_cached_setting __setting ( SETTING_MISC ) = {
- .name = "use-cached",
- .description = "Use cached settings",
- .tag = DHCP_EB_USE_CACHED,
- .type = &setting_type_uint8,
-};
-
/**
* Most recent DHCP transaction ID
*
@@ -1285,37 +1277,20 @@ static struct sockaddr dhcp_peer = {
};
/**
- * Get cached DHCPACK where none exists
- */
-__weak void get_cached_dhcpack ( void ) { __keepme }
-
-/**
* Start DHCP state machine on a network device
*
* @v job Job control interface
* @v netdev Network device
- * @ret rc Return status code, or positive if cached
+ * @ret rc Return status code
*
* Starts DHCP on the specified network device. If successful, the
* DHCPACK (and ProxyDHCPACK, if applicable) will be registered as
* option sources.
- *
- * On a return of 0, a background job has been started to perform the
- * DHCP request. Any nonzero return means the job has not been
- * started; a positive return value indicates the success condition of
- * having fetched the appropriate data from cached information.
*/
int start_dhcp ( struct interface *job, struct net_device *netdev ) {
struct dhcp_session *dhcp;
int rc;
- /* Check for cached DHCP information */
- get_cached_dhcpack();
- if ( fetch_uintz_setting ( NULL, &use_cached_setting ) ) {
- DBG ( "DHCP using cached network settings\n" );
- return 1;
- }
-
/* Allocate and initialise structure */
dhcp = zalloc ( sizeof ( *dhcp ) );
if ( ! dhcp )