[edk2] [Patch 3/4] MdeModulePkg/UefiBootManagerLib: Support DNS device path description

Jiaxin Wu posted 4 patches 7 years, 5 months ago
[edk2] [Patch 3/4] MdeModulePkg/UefiBootManagerLib: Support DNS device path description
Posted by Jiaxin Wu 7 years, 5 months ago
This patch is to update UEFI Boot manager to support DNS device path
for HTTP(S) network boot.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
index 6e69a15..7647bac 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
@@ -385,12 +385,12 @@ BmGetNetworkDescription (
   //   ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]
   //   ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)
   //   ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)
   //
   // The HTTP device path is like:
-  //   ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)/Uri(...)
-  //   ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)/Uri(...)
+  //   ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)
+  //   ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)
   //
   while (!IsDevicePathEnd (DevicePath) &&
          ((DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH) ||
           (DevicePathSubType (DevicePath) != MSG_MAC_ADDR_DP))
          ) {
@@ -435,10 +435,19 @@ BmGetNetworkDescription (
     Ip = DevicePath;
     DevicePath = NextDevicePathNode (DevicePath);
   } else {
     Ip = NULL;
   }
+  
+  //
+  // Skip the optional DNS node
+  //
+  if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
+      (DevicePathSubType (DevicePath) == MSG_DNS_DP)
+      ) {
+    DevicePath = NextDevicePathNode (DevicePath);
+  }
 
   //
   // Locate the URI node
   //
   if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel