summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/interface
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/arch/i386/interface
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/arch/i386/interface')
-rw-r--r--src/arch/i386/interface/pxeparent/pxeparent_dhcp.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/arch/i386/interface/pxeparent/pxeparent_dhcp.c b/src/arch/i386/interface/pxeparent/pxeparent_dhcp.c
deleted file mode 100644
index f37286335..000000000
--- a/src/arch/i386/interface/pxeparent/pxeparent_dhcp.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2009 Joshua Oreman <oremanj@rwcr.net>.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include <string.h>
-#include <ipxe/dhcp.h>
-#include <ipxe/netdevice.h>
-#include <undipreload.h>
-#include <pxeparent.h>
-#include <realmode.h>
-#include <pxe_api.h>
-
-/**
- * Present cached DHCP packet if it exists
- */
-void get_cached_dhcpack ( void ) {
- struct undi_device *undi;
- struct s_PXENV_GET_CACHED_INFO get_cached_info;
- int rc;
-
- /* Use preloaded UNDI device to get at PXE entry point */
- undi = &preloaded_undi;
- if ( ! undi->entry.segment ) {
- DBG ( "PXEDHCP no preloaded UNDI device found\n" );
- return;
- }
-
- /* Check that stack is available to get cached info */
- if ( ! ( undi->flags & UNDI_FL_KEEP_ALL ) ) {
- DBG ( "PXEDHCP stack was unloaded, no cache available\n" );
- return;
- }
-
- /* Obtain cached DHCP packet */
- memset ( &get_cached_info, 0, sizeof ( get_cached_info ) );
- get_cached_info.PacketType = PXENV_PACKET_TYPE_DHCP_ACK;
-
- if ( ( rc = pxeparent_call ( undi->entry, PXENV_GET_CACHED_INFO,
- &get_cached_info,
- sizeof ( get_cached_info ) ) ) != 0 ) {
- DBG ( "PXEDHCP GET_CACHED_INFO failed: %s\n", strerror ( rc ) );
- return;
- }
-
- DBG ( "PXEDHCP got cached info at %04x:%04x length %d\n",
- get_cached_info.Buffer.segment, get_cached_info.Buffer.offset,
- get_cached_info.BufferSize );
-
- /* Present cached DHCP packet */
- store_cached_dhcpack ( real_to_user ( get_cached_info.Buffer.segment,
- get_cached_info.Buffer.offset ),
- get_cached_info.BufferSize );
-}