From 30a95d4d39214084f435acbc1534cb111dda3095 Mon Sep 17 00:00:00 2001 From: sfu5 Date: Thu, 9 May 2013 05:28:27 +0000 Subject: Skip PXE prompt/menu/discover if PXE_DISCOVERY_CONTROL tag bit 3 set. Signed-off-by: Laszlo Ersek Reviewed-by: Ye Ting Reviewed-by: Fu Siyuan git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14332 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 12 +++++++++++- MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index fa3594d36b..6bca31967c 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -1,7 +1,7 @@ /** @file Support for PxeBc dhcp functions. -Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
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 @@ -1536,6 +1536,16 @@ PxeBcSelectBootPrompt ( } VendorOpt = &Packet->PxeVendorOption; + // + // According to the PXE specification 2.1, Table 2-1 PXE DHCP Options, + // we must not consider a boot prompt or boot menu if all of the following hold: + // - the PXE_DISCOVERY_CONTROL tag(6) is present inside the Vendor Options(43), and has bit 3 set + // - a boot file name has been presented in the initial DHCP or ProxyDHCP offer packet. + // + if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) && + Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) { + return EFI_ABORTED; + } if (!IS_VALID_BOOT_PROMPT (VendorOpt->BitMap)) { return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h index 5e37228efa..9045251f59 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h @@ -1,7 +1,7 @@ /** @file Dhcp and Discover routines for PxeBc. -Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
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 @@ -160,7 +160,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define IS_DISABLE_BCAST_DISCOVER(x) (((x) & BIT (0)) == BIT (0)) #define IS_DISABLE_MCAST_DISCOVER(x) (((x) & BIT (1)) == BIT (1)) #define IS_ENABLE_USE_SERVER_LIST(x) (((x) & BIT (2)) == BIT (2)) -#define IS_ENABLE_BOOT_FILE_NAME(x) (((x) & BIT (3)) == BIT (3)) +#define IS_DISABLE_PROMPT_MENU(x) (((x) & BIT (3)) == BIT (3)) #define SET_VENDOR_OPTION_BIT_MAP(x, y) (((x)[(y) / 32]) = (UINT32) ((x)[(y) / 32]) | BIT ((y) % 32)) -- cgit v1.2.3