summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2016-05-03 13:29:52 +0800
committerFu Siyuan <siyuan.fu@intel.com>2016-05-06 11:42:24 +0800
commitaa437778fcbcce7ec86414b0f72ad9aa4df03d53 (patch)
treedc4679c3b462f4fafaff690b9903d7771dfea9ea /NetworkPkg
parentb7f28e1a6ce0eabbc04e87c39fc3b5a0a7b34a6c (diff)
downloadedk2-platforms-aa437778fcbcce7ec86414b0f72ad9aa4df03d53.tar.xz
NetworkPkg: Ignore BootFileName if it is overloaded.
Make sure "File" field is not overloaded to carry other DHCP options before use it in PXE driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index 587566d4e0..818586f955 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -1,7 +1,7 @@
/** @file
Functions implementation related with DHCPv4 for UefiPxeBc Driver.
- Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -460,9 +460,11 @@ PxeBcParseDhcp4Packet (
BOOLEAN IsProxyOffer;
BOOLEAN IsPxeOffer;
UINT8 *Ptr8;
+ BOOLEAN FileFieldOverloaded;
IsProxyOffer = FALSE;
IsPxeOffer = FALSE;
+ FileFieldOverloaded = FALSE;
ZeroMem (Cache4->OptList, sizeof (Cache4->OptList));
ZeroMem (&Cache4->VendorOpt, sizeof (Cache4->VendorOpt));
@@ -488,6 +490,7 @@ PxeBcParseDhcp4Packet (
Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
if (Option != NULL) {
if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0) {
+ FileFieldOverloaded = TRUE;
for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
if (Options[Index] == NULL) {
Options[Index] = PxeBcParseDhcp4Options (
@@ -550,7 +553,7 @@ PxeBcParseDhcp4Packet (
if (*(Ptr8 - 1) != '\0') {
*Ptr8 = '\0';
}
- } else if (Offer->Dhcp4.Header.BootFileName[0] != 0) {
+ } else if (!FileFieldOverloaded && Offer->Dhcp4.Header.BootFileName[0] != 0) {
//
// If the bootfile is not present and bootfilename is present in DHCPv4 packet, just parse it.
// Do not count dhcp option header here, or else will destroy the serverhostname.