summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpBootDxe
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2016-05-03 13:29:23 +0800
committerFu Siyuan <siyuan.fu@intel.com>2016-05-06 11:42:11 +0800
commitb7f28e1a6ce0eabbc04e87c39fc3b5a0a7b34a6c (patch)
tree20238efc278d467a5b78a9e45251bf04391b9a87 /NetworkPkg/HttpBootDxe
parent61e0f079bcf1b4e6ae9a00c7ae0ae0bd91a2d822 (diff)
downloadedk2-b7f28e1a6ce0eabbc04e87c39fc3b5a0a7b34a6c.tar.gz
edk2-b7f28e1a6ce0eabbc04e87c39fc3b5a0a7b34a6c.tar.bz2
edk2-b7f28e1a6ce0eabbc04e87c39fc3b5a0a7b34a6c.zip
NetworkPkg: Ignore BootFileName if it is overloaded.
Make sure "File" field is not overloaded to carry other DHCP options before use it in HTTP boot 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/HttpBootDxe')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootDhcp4.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c b/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c
index b9c8084e11..5a226d7f76 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c
@@ -259,11 +259,13 @@ HttpBootParseDhcp4Packet (
EFI_STATUS Status;
HTTP_BOOT_OFFER_TYPE OfferType;
EFI_IPv4_ADDRESS IpAddr;
+ BOOLEAN FileFieldOverloaded;
IsDnsOffer = FALSE;
IpExpressedUri = FALSE;
IsProxyOffer = FALSE;
IsHttpOffer = FALSE;
+ FileFieldOverloaded = FALSE;
ZeroMem (Cache4->OptList, sizeof (Cache4->OptList));
@@ -288,6 +290,7 @@ HttpBootParseDhcp4Packet (
Option = Options[HTTP_BOOT_DHCP4_TAG_INDEX_OVERLOAD];
if (Option != NULL) {
if ((Option->Data[0] & HTTP_BOOT_DHCP4_OVERLOAD_FILE) != 0) {
+ FileFieldOverloaded = TRUE;
for (Index = 0; Index < HTTP_BOOT_DHCP4_TAG_INDEX_MAX; Index++) {
if (Options[Index] == NULL) {
Options[Index] = HttpBootParseDhcp4Options (
@@ -351,7 +354,7 @@ HttpBootParseDhcp4Packet (
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.