[pxe] Construct all fake DHCP packets before starting PXE NBP
authorMichael Brown <mcb30@ipxe.org>
Sat, 29 Aug 2015 15:49:54 +0000 (16:49 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sat, 29 Aug 2015 15:58:12 +0000 (16:58 +0100)
commit2ef04f092c1449ba4cff631d5127455ddecc505f
tree8f3329c12b184b1a85da24aaa3d1b30e6411fff3
parentc522c11c7b7adedf0bf339b954e30951f02d568f
[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>
src/arch/i386/image/pxe_image.c
src/arch/i386/include/pxe.h
src/arch/i386/interface/pxe/pxe_preboot.c