* [Patch] MdeModulePkg/UefiBootManagerLib: Skip the DNS device path node check.
@ 2018-01-23 7:14 Jiaxin Wu
2018-01-24 3:24 ` Ni, Ruiyu
0 siblings, 1 reply; 2+ messages in thread
From: Jiaxin Wu @ 2018-01-23 7:14 UTC (permalink / raw)
To: edk2-devel; +Cc: Ruiyu Ni, Ye Ting, Fu Siyuan, Wu Jiaxin
After HTTP boot successfully in home mode, the HTTP device path will be
updated accordingly. So, the new device path may be appended with a DNS
device path node. When executing home mode boot again, the original HTTP
device path will mismatch with the new updated one, which will cause the
HTTP boot failure. So, we need update the current match algorithm to match
the correct FilePath. Since the DNS device path is an optional, we can skip
it check.
This patch is to fix above issue.
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
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/BmBoot.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index d684482..6404233 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1,9 +1,9 @@
/** @file
Library functions which relates with booting.
-Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<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
http://opensource.org/licenses/bsd-license.php
@@ -1117,10 +1117,18 @@ BmMatchHttpBootDevicePath (
if (CompareMem (Left, Right, DevicePathNodeLength (Left)) != 0) {
if ((DevicePathType (Left) != MESSAGING_DEVICE_PATH) || (DevicePathType (Right) != MESSAGING_DEVICE_PATH)) {
return FALSE;
}
+ if (DevicePathSubType (Left) == MSG_DNS_DP) {
+ Left = NextDevicePathNode (Left);
+ }
+
+ if (DevicePathSubType (Right) == MSG_DNS_DP) {
+ Right = NextDevicePathNode (Right);
+ }
+
if (((DevicePathSubType (Left) != MSG_IPv4_DP) || (DevicePathSubType (Right) != MSG_IPv4_DP)) &&
((DevicePathSubType (Left) != MSG_IPv6_DP) || (DevicePathSubType (Right) != MSG_IPv6_DP)) &&
((DevicePathSubType (Left) != MSG_URI_DP) || (DevicePathSubType (Right) != MSG_URI_DP))
) {
return FALSE;
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] MdeModulePkg/UefiBootManagerLib: Skip the DNS device path node check.
2018-01-23 7:14 [Patch] MdeModulePkg/UefiBootManagerLib: Skip the DNS device path node check Jiaxin Wu
@ 2018-01-24 3:24 ` Ni, Ruiyu
0 siblings, 0 replies; 2+ messages in thread
From: Ni, Ruiyu @ 2018-01-24 3:24 UTC (permalink / raw)
To: Jiaxin Wu, edk2-devel; +Cc: Ye Ting, Fu Siyuan
On 1/23/2018 3:14 PM, Jiaxin Wu wrote:
> After HTTP boot successfully in home mode, the HTTP device path will be
> updated accordingly. So, the new device path may be appended with a DNS
> device path node. When executing home mode boot again, the original HTTP
> device path will mismatch with the new updated one, which will cause the
> HTTP boot failure. So, we need update the current match algorithm to match
> the correct FilePath. Since the DNS device path is an optional, we can skip
> it check.
>
> This patch is to fix above issue.
>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> 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/BmBoot.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index d684482..6404233 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -1,9 +1,9 @@
> /** @file
> Library functions which relates with booting.
>
> -Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
> (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<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
> http://opensource.org/licenses/bsd-license.php
> @@ -1117,10 +1117,18 @@ BmMatchHttpBootDevicePath (
> if (CompareMem (Left, Right, DevicePathNodeLength (Left)) != 0) {
> if ((DevicePathType (Left) != MESSAGING_DEVICE_PATH) || (DevicePathType (Right) != MESSAGING_DEVICE_PATH)) {
> return FALSE;
> }
>
> + if (DevicePathSubType (Left) == MSG_DNS_DP) {
> + Left = NextDevicePathNode (Left);
> + }
> +
> + if (DevicePathSubType (Right) == MSG_DNS_DP) {
> + Right = NextDevicePathNode (Right);
> + }
> +
> if (((DevicePathSubType (Left) != MSG_IPv4_DP) || (DevicePathSubType (Right) != MSG_IPv4_DP)) &&
> ((DevicePathSubType (Left) != MSG_IPv6_DP) || (DevicePathSubType (Right) != MSG_IPv6_DP)) &&
> ((DevicePathSubType (Left) != MSG_URI_DP) || (DevicePathSubType (Right) != MSG_URI_DP))
> ) {
> return FALSE;
>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
--
Thanks,
Ray
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-24 3:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 7:14 [Patch] MdeModulePkg/UefiBootManagerLib: Skip the DNS device path node check Jiaxin Wu
2018-01-24 3:24 ` Ni, Ruiyu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox