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.24; helo=mga09.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 BD06D22423830 for ; Wed, 28 Feb 2018 22:59:47 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2018 23:05:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="34580480" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2018 23:05:55 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Feb 2018 23:05:55 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Feb 2018 23:05:53 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.130]) with mapi id 14.03.0319.002; Thu, 1 Mar 2018 15:05:51 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Wu, Jiaxin" Thread-Topic: [edk2] [Patch] NetworkPkg/HttpBootDxe: Fix the incorrect error message output. Thread-Index: AQHTsSayEH+e7FV7P0aPUSgsFUeqQ6O69SEQ Date: Thu, 1 Mar 2018 07:05:50 +0000 Message-ID: References: <20180301062932.14280-1-jiaxin.wu@intel.com> <20180301062932.14280-2-jiaxin.wu@intel.com> In-Reply-To: <20180301062932.14280-2-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTViODZjNjYtYjEyYS00MTlhLTliMWItYzUyZTA3Mjc2NDRkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJYMEJBOENLbjYzWHV4Y3V1OCs5VFBCZmFMRHVUREJBRTg2TVhVZHlIMTgyWXNMYnhVbHl1cXVXR0F0bXV3WENwIn0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg/HttpBootDxe: Fix the incorrect error message output. 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: Thu, 01 Mar 2018 06:59:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Jiaxin Wu > Sent: Thursday, March 1, 2018 2:30 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [edk2] [Patch] NetworkPkg/HttpBootDxe: Fix the incorrect error > message output. >=20 > For IPv6 case, if one invalid URL returned from DHCP server, HttpBootDxe > driver could not retrieve the URL host address from DNS server. In such a > case, the error message should be printed as: > Error: Could not retrieve the host address from DNS server. > Instead of: > Error: Could not discover the boot information for DHCP server. > Then, we can still output as following: > Error: Could not retrieve NBP file size from HTTP server. >=20 > Besides, currently implementation in HttpBootLoadFile will always output > error message even the HTTP process is correct. >=20 > This patch is to fix above issue. >=20 > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wu Jiaxin > --- > NetworkPkg/HttpBootDxe/HttpBootClient.c | 1 + > NetworkPkg/HttpBootDxe/HttpBootImpl.c | 37 ++++++++++++++++++---------= - > ----- > 2 files changed, 21 insertions(+), 17 deletions(-) >=20 > diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c > b/NetworkPkg/HttpBootDxe/HttpBootClient.c > index b93e63bb2f..1d1e47008d 100644 > --- a/NetworkPkg/HttpBootDxe/HttpBootClient.c > +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c > @@ -472,10 +472,11 @@ HttpBootDhcp6ExtractUriInfo ( > } >=20 > Status =3D HttpBootDns (Private, HostNameStr, &IpAddr); > FreePool (HostNameStr); > if (EFI_ERROR (Status)) { > + AsciiPrint ("\n Error: Could not retrieve the host address from > DNS server.\n"); > goto Error; > } > } >=20 > CopyMem (&Private->ServerIp.v6, &IpAddr, sizeof (EFI_IPv6_ADDRESS)); > diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c > b/NetworkPkg/HttpBootDxe/HttpBootImpl.c > index 16c1207bf8..a0fd934ec4 100644 > --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c > +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c > @@ -1,9 +1,9 @@ > /** @file > The implementation of EFI_LOAD_FILE_PROTOCOL for UEFI HTTP boot. >=20 > -Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
> (C) Copyright 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 that accompanies this > distribution. > The full text of the license may be found at > http://opensource.org/licenses/bsd-license.php. > @@ -329,11 +329,11 @@ HttpBootLoadFile ( > // > // Parse the cached offer to get the boot file URL first. > // > Status =3D HttpBootDiscoverBootInfo (Private); > if (EFI_ERROR (Status)) { > - AsciiPrint ("\n Error: Could not discover the boot information fo= r > DHCP server.\n"); > + AsciiPrint ("\n Error: Could not retrieve NBP file size from HTTP > server.\n"); > goto ON_EXIT; > } > } >=20 > if (!Private->HttpCreated) { > @@ -398,26 +398,29 @@ HttpBootLoadFile ( > ImageType > ); >=20 > ON_EXIT: > HttpBootUninstallCallback (Private); > - > - if (Status =3D=3D EFI_ACCESS_DENIED) { > - AsciiPrint ("\n Error: Could not establish connection with HTTP > server.\n"); > - } else if (Status =3D=3D EFI_BUFFER_TOO_SMALL && Buffer !=3D NULL) { > - AsciiPrint ("\n Error: Buffer size is smaller than the requested > file.\n"); > - } else if (Status =3D=3D EFI_OUT_OF_RESOURCES) { > - AsciiPrint ("\n Error: Could not allocate I/O buffers.\n"); > - } else if (Status =3D=3D EFI_DEVICE_ERROR) { > - AsciiPrint ("\n Error: Network device error.\n"); > - } else if (Status =3D=3D EFI_TIMEOUT) { > - AsciiPrint ("\n Error: Server response timeout.\n"); > - } else if (Status =3D=3D EFI_ABORTED) { > - AsciiPrint ("\n Error: Remote boot cancelled.\n"); > - } else if (Status !=3D EFI_BUFFER_TOO_SMALL) { > - AsciiPrint ("\n Error: Unexpected network error.\n"); > + > + if (EFI_ERROR (Status)) { > + if (Status =3D=3D EFI_ACCESS_DENIED) { > + AsciiPrint ("\n Error: Could not establish connection with HTTP > server.\n"); > + } else if (Status =3D=3D EFI_BUFFER_TOO_SMALL && Buffer !=3D NULL) { > + AsciiPrint ("\n Error: Buffer size is smaller than the requested > file.\n"); > + } else if (Status =3D=3D EFI_OUT_OF_RESOURCES) { > + AsciiPrint ("\n Error: Could not allocate I/O buffers.\n"); > + } else if (Status =3D=3D EFI_DEVICE_ERROR) { > + AsciiPrint ("\n Error: Network device error.\n"); > + } else if (Status =3D=3D EFI_TIMEOUT) { > + AsciiPrint ("\n Error: Server response timeout.\n"); > + } else if (Status =3D=3D EFI_ABORTED) { > + AsciiPrint ("\n Error: Remote boot cancelled.\n"); > + } else if (Status !=3D EFI_BUFFER_TOO_SMALL) { > + AsciiPrint ("\n Error: Unexpected network error.\n"); > + } > } > + > return Status; > } >=20 > /** > Disable the use of UEFI HTTP boot function. > -- > 2.16.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel