summaryrefslogtreecommitdiffstats
path: root/src/usr/dhcpmgmt.c
diff options
context:
space:
mode:
authorMichael Brown2013-10-25 18:24:09 +0200
committerMichael Brown2013-10-25 18:29:25 +0200
commit10d19bd2ac302cd5237e7b1ca200760594a3c8c2 (patch)
tree8759bfa0d517e82eeec8ca3829f56cd291465fda /src/usr/dhcpmgmt.c
parent[ipv6] Automatically choose source for link-local and multicast destinations (diff)
downloadipxe-10d19bd2ac302cd5237e7b1ca200760594a3c8c2.tar.gz
ipxe-10d19bd2ac302cd5237e7b1ca200760594a3c8c2.tar.xz
ipxe-10d19bd2ac302cd5237e7b1ca200760594a3c8c2.zip
[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/usr/dhcpmgmt.c')
-rw-r--r--src/usr/dhcpmgmt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/usr/dhcpmgmt.c b/src/usr/dhcpmgmt.c
index b61c01aa..10d8ecfa 100644
--- a/src/usr/dhcpmgmt.c
+++ b/src/usr/dhcpmgmt.c
@@ -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;
}