[pxe] Construct all fake DHCP packets before starting PXE NBP

Commit edf74df ("[pxe] Always reconstruct packet for
PXENV_GET_CACHED_INFO") fixed the problems caused by returning stale
DHCP packets (e.g. from an earlier boot attempt using a different
network device), but broke interoperability with NBPs such as WDS
which may overwrite our cached (fake) DHCP packets and expect the
modified packets to be returned by a subsequent call to
PXENV_GET_CACHED_INFO.

Fix by constructing the fake DHCP packets immediately before
transferring control to a PXE NBP.  Calls to PXENV_GET_CACHED_INFO
will now never modify the cached packets.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-08-29 16:49:54 +01:00
parent c522c11c7b
commit 2ef04f092c
3 changed files with 38 additions and 24 deletions

View File

@@ -78,6 +78,9 @@ static int pxe_exec ( struct image *image ) {
/* Activate PXE */
pxe_activate ( netdev );
/* Construct fake DHCP packets */
pxe_fake_cached_info();
/* Set PXE command line */
pxe_cmdline = image->cmdline;