]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
Skip PXE prompt/menu/discover if PXE_DISCOVERY_CONTROL tag bit 3 set.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcDhcp.c
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