summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/efi/mnpnet.c
diff options
context:
space:
mode:
authorMichael Brown2024-04-02 20:36:00 +0200
committerMichael Brown2024-04-02 23:59:50 +0200
commitb940d54235579f2534c12494322876fff555cf36 (patch)
treec01091023d13a54e37f0a18b183e41bbf705e721 /src/drivers/net/efi/mnpnet.c
parent[efi] Add the ability to create a temporary MNP network device (diff)
downloadipxe-b940d54235579f2534c12494322876fff555cf36.tar.gz
ipxe-b940d54235579f2534c12494322876fff555cf36.tar.xz
ipxe-b940d54235579f2534c12494322876fff555cf36.zip
[cachedhcp] Allow cached DHCPACK to apply to temporary network devices
Retain a reference to the cached DHCPACK until the late startup phase, and allow it to be recycled for reuse. This allows the cached DHCPACK to be used for a temporary MNP network device and then subsequently reused for the corresponding real network device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/efi/mnpnet.c')
-rw-r--r--src/drivers/net/efi/mnpnet.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/net/efi/mnpnet.c b/src/drivers/net/efi/mnpnet.c
index 84f803f4..eb4b129c 100644
--- a/src/drivers/net/efi/mnpnet.c
+++ b/src/drivers/net/efi/mnpnet.c
@@ -34,6 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/iobuf.h>
#include <ipxe/netdevice.h>
#include <ipxe/ethernet.h>
+#include <ipxe/cachedhcp.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_driver.h>
#include <ipxe/efi/efi_service.h>
@@ -551,6 +552,9 @@ void mnptemp_destroy ( struct net_device *netdev ) {
struct mnp_nic *mnp = netdev->priv;
struct efi_device *efidev = mnp->efidev;
+ /* Recycle any cached DHCP packet */
+ cachedhcp_recycle ( netdev );
+
/* Stop temporary network device */
mnpnet_stop ( efidev );