From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5AC3322333778 for ; Tue, 23 Jan 2018 19:19:14 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 19:24:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,405,1511856000"; d="scan'208";a="24941886" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.19]) ([10.239.9.19]) by fmsmga001.fm.intel.com with ESMTP; 23 Jan 2018 19:24:40 -0800 To: Jiaxin Wu , edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan References: <1516691662-12156-1-git-send-email-jiaxin.wu@intel.com> From: "Ni, Ruiyu" Message-ID: Date: Wed, 24 Jan 2018 11:24:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516691662-12156-1-git-send-email-jiaxin.wu@intel.com> Subject: Re: [Patch] MdeModulePkg/UefiBootManagerLib: Skip the DNS device path node check. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 03:19:14 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wu Jiaxin > --- > 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.
> +Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
> (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
> 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 -- Thanks, Ray