Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: chenzhihui <[email protected]>
Signed-off-by: Heyi Guo <[email protected]>
Cc: Feng Tian <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Siyuan Fu <[email protected]>
Cc: Jiaxin Wu <[email protected]>
---
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
index 6c06373..6108be5 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
@@ -228,9 +228,12 @@ PxeBcParseCachedDhcpPacket (
// If the bootfile is not present and bootfilename is present in dhcp
packet, just parse it.
// And do not count dhcp option header, or else will destroy the
serverhostname.
//
- Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *)
(&Offer->Dhcp4.Header.BootFileName[0] -
+ // Make sure "BootFileName" is not overloaded
+ if (Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD] == NULL ||
+ (Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD]->Data[0] &
PXEBC_DHCP4_OVERLOAD_FILE) == 0) {
+ Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *)
(&Offer->Dhcp4.Header.BootFileName[0] -
OFFSET_OF
(EFI_DHCP4_PACKET_OPTION, Data[0]));
-
+ }
}
//
--
2.7.0
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel