Revision: 14332
http://edk2.svn.sourceforge.net/edk2/?rev=14332&view=rev
Author: sfu5
Date: 2013-05-09 05:28:27 +0000 (Thu, 09 May 2013)
Log Message:
-----------
Skip PXE prompt/menu/discover if PXE_DISCOVERY_CONTROL tag bit 3 set.
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h
Modified: trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
2013-05-09 04:06:58 UTC (rev 14331)
+++ trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
2013-05-09 05:28:27 UTC (rev 14332)
@@ -1,7 +1,7 @@
/** @file
Support for PxeBc dhcp functions.
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, 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
@@ -1536,6 +1536,16 @@
}
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;
Modified: trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
2013-05-09 04:06:58 UTC (rev 14331)
+++ trunk/edk2/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
2013-05-09 05:28:27 UTC (rev 14332)
@@ -1,7 +1,7 @@
/** @file
Dhcp and Discover routines for PxeBc.
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, 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
@@ -160,7 +160,7 @@
#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))
Modified: trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
===================================================================
--- trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c 2013-05-09 04:06:58 UTC
(rev 14331)
+++ trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c 2013-05-09 05:28:27 UTC
(rev 14332)
@@ -98,6 +98,17 @@
ASSERT (!Mode->UsingIpv6);
VendorOpt = &Cache->Dhcp4.VendorOpt;
+ //
+ // 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) &&
+ Cache->Dhcp4.OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
+ return EFI_ABORTED;
+ }
+
if (!IS_VALID_BOOT_PROMPT (VendorOpt->BitMap)) {
return EFI_TIMEOUT;
}
Modified: trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h
===================================================================
--- trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h 2013-05-09 04:06:58 UTC
(rev 14331)
+++ trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h 2013-05-09 05:28:27 UTC
(rev 14332)
@@ -1,7 +1,7 @@
/** @file
Functions declaration related with DHCPv4 for UefiPxeBc Driver.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, 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
@@ -200,7 +200,7 @@
#define IS_ENABLE_USE_SERVER_LIST(x) \
(((x) & BIT (2)) == BIT (2))
-#define IS_ENABLE_BOOT_FILE_NAME(x) \
+#define IS_DISABLE_PROMPT_MENU(x) \
(((x) & BIT (3)) == BIT (3))
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits