]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Skip PXE prompt/menu/discover if PXE_DISCOVERY_CONTROL tag bit 3 set.
authorsfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 9 May 2013 05:28:27 +0000 (05:28 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 9 May 2013 05:28:27 +0000 (05:28 +0000)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14332 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h

index fa3594d36b0e17a9f71e79d1d0bea666a33a4d1d..6bca31967c95088a389ba11ac8056543440d66eb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support for PxeBc dhcp functions.\r
 \r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1536,6 +1536,16 @@ PxeBcSelectBootPrompt (
   }\r
 \r
   VendorOpt = &Packet->PxeVendorOption;\r
+  //\r
+  // According to the PXE specification 2.1, Table 2-1 PXE DHCP Options,\r
+  // we must not consider a boot prompt or boot menu if all of the following hold:\r
+  //   - the PXE_DISCOVERY_CONTROL tag(6) is present inside the Vendor Options(43), and has bit 3 set  \r
+  //   - a boot file name has been presented in the initial DHCP or ProxyDHCP offer packet.\r
+  //\r
+  if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) &&\r
+      Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {\r
+    return EFI_ABORTED;\r
+  }\r
 \r
   if (!IS_VALID_BOOT_PROMPT (VendorOpt->BitMap)) {\r
     return EFI_SUCCESS;\r
index 5e37228efa321a9e486e16d7d511fdc8246b2e51..9045251f592de75df4a983926ba9ed0e9b555f00 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Dhcp and Discover routines for PxeBc.\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -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))\r
 #define IS_DISABLE_MCAST_DISCOVER(x)    (((x) & BIT (1)) == BIT (1))\r
 #define IS_ENABLE_USE_SERVER_LIST(x)    (((x) & BIT (2)) == BIT (2))\r
-#define IS_ENABLE_BOOT_FILE_NAME(x)     (((x) & BIT (3)) == BIT (3))\r
+#define IS_DISABLE_PROMPT_MENU(x)       (((x) & BIT (3)) == BIT (3))\r
 \r
 #define SET_VENDOR_OPTION_BIT_MAP(x, y) (((x)[(y) / 32]) = (UINT32) ((x)[(y) / 32]) | BIT ((y) % 32))\r
 \r
index 540adee3113e412374d57342ea91b67401ba9070..5bbefcee9d4f075e21a4bf8f4c265ea6327ff649 100644 (file)
@@ -98,6 +98,17 @@ PxeBcSelectBootPrompt (
   ASSERT (!Mode->UsingIpv6);\r
 \r
   VendorOpt = &Cache->Dhcp4.VendorOpt;\r
+  //\r
+  // According to the PXE specification 2.1, Table 2-1 PXE DHCP Options,\r
+  // we must not consider a boot prompt or boot menu if all of the following hold:\r
+  //   - the PXE_DISCOVERY_CONTROL tag(6) is present inside the Vendor Options(43), and has bit 3 set  \r
+  //   - a boot file name has been presented in the initial DHCP or ProxyDHCP offer packet.\r
+  //\r
+  if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) &&\r
+      Cache->Dhcp4.OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {\r
+    return EFI_ABORTED;\r
+  }\r
+  \r
   if (!IS_VALID_BOOT_PROMPT (VendorOpt->BitMap)) {\r
     return EFI_TIMEOUT;\r
   }\r
index 37747ac74f44726eb09a816e7830a6e8528e7b3a..ee519d9ee2724261d2396e5eec883e2708ab1145 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Functions declaration related with DHCPv4 for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -200,7 +200,7 @@ typedef enum {
 #define IS_ENABLE_USE_SERVER_LIST(x) \\r
   (((x) & BIT (2)) == BIT (2))\r
 \r
-#define IS_ENABLE_BOOT_FILE_NAME(x) \\r
+#define IS_DISABLE_PROMPT_MENU(x) \\r
   (((x) & BIT (3)) == BIT (3))\r
 \r
 \r