mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
MdeModulePkg: Ignore BootFileName if it is overloaded.
Make sure "BootFileName" is not overloaded before use it in PXE driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: chenzhihui <chenzhihui4@huawei.com> Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
parent
a1522257a9
commit
61e0f079bc
@ -2,7 +2,7 @@
|
||||
Support for PxeBc dhcp functions.
|
||||
|
||||
Copyright (c) 2013, Red Hat, Inc.
|
||||
Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 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
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -228,9 +228,13 @@ 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]));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user