summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaloni Kasbekar <saloni.kasbekar@intel.com>2022-12-16 18:49:23 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-03-13 00:34:01 +0000
commit592ff1e98fc5d4a0e217d0420af7a8025e1a8213 (patch)
treea389b5a970b3c41db1773e11fde9f37e2985b09d
parent7f0fc4189a4abe252ea1ca9054ae5c49480f1a4c (diff)
downloadedk2-592ff1e98fc5d4a0e217d0420af7a8025e1a8213.zip
edk2-592ff1e98fc5d4a0e217d0420af7a8025e1a8213.tar.gz
edk2-592ff1e98fc5d4a0e217d0420af7a8025e1a8213.tar.bz2
MdeModulePkg/UefiBootManagerLib: Handle device path with Proxy URI.
Update library to handle HTTP Boot device paths with Proxy URI Implementation based on UEFI Specification v2.11 Section 24.7.3.1 Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c44
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c4
2 files changed, 46 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index f154520..3343e60 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1541,6 +1541,11 @@ BmExpandLoadFiles (
UINTN HandleCount;
UINTN Index;
EFI_DEVICE_PATH_PROTOCOL *Node;
+ EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *HttpPath;
+ URI_DEVICE_PATH *NullUriPath;
+
+ NullUriPath = NULL;
//
// Get file buffer from load file instance.
@@ -1573,11 +1578,50 @@ BmExpandLoadFiles (
for (Index = 0; Index < HandleCount; Index++) {
if (BmMatchHttpBootDevicePath (DevicePathFromHandle (Handles[Index]), FilePath)) {
+ //
+ // Matches HTTP Boot Device Path described as
+ // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)
+ // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)
+ //
+ Handle = Handles[Index];
+ goto Done;
+ }
+ }
+
+ NullUriPath = (URI_DEVICE_PATH *)CreateDeviceNode (
+ MESSAGING_DEVICE_PATH,
+ MSG_URI_DP,
+ (UINT16)(sizeof (URI_DEVICE_PATH))
+ );
+ for (Index = 0; Index < HandleCount; Index++) {
+ if ((Handles == NULL) || (Handles[Index] == NULL)) {
+ continue;
+ }
+
+ NewDevicePath = DevicePathFromHandle (Handles[Index]);
+ if (NewDevicePath == NULL) {
+ continue;
+ }
+
+ HttpPath = AppendDevicePathNode (NewDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)NullUriPath);
+ if (HttpPath == NULL) {
+ continue;
+ }
+
+ if (BmMatchHttpBootDevicePath (HttpPath, FilePath)) {
+ //
+ // Matches HTTP Boot Device Path described as
+ // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)/Uri(...)
+ // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)/Uri(...)
+ //
Handle = Handles[Index];
break;
}
}
+ FreePool (NullUriPath);
+
+Done:
if (Handles != NULL) {
FreePool (Handles);
}
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
index 435d57b..6106aa5 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
@@ -649,8 +649,8 @@ BmGetNetworkDescription (
// ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)
//
// The HTTP device path is like:
- // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)
- // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)
+ // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)][/Uri(...)]/Uri(...)
+ // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)][/Uri(...)]/Uri(...)
//
while (!IsDevicePathEnd (DevicePath) &&
((DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH) ||