From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 4F58C82215 for ; Fri, 3 Mar 2017 00:27:10 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 03 Mar 2017 00:27:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,236,1484035200"; d="scan'208";a="1104314845" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 03 Mar 2017 00:27:09 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 3 Mar 2017 00:27:09 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 3 Mar 2017 00:27:08 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Fri, 3 Mar 2017 16:27:06 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: Naveen Santhapur , "Fu, Siyuan" Thread-Topic: [Patch] NetworkPkg/Dhcp6Dxe: Handle the Nil UUID case Thread-Index: AQHSk/H4ZHHmYVqxSEekCeOrtXzrnaGCx+1Q Date: Fri, 3 Mar 2017 08:27:05 +0000 Message-ID: References: <1488527027-182460-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1488527027-182460-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg/Dhcp6Dxe: Handle the Nil UUID case X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 08:27:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting =20 -----Original Message----- From: Wu, Jiaxin=20 Sent: Friday, March 03, 2017 3:44 PM To: edk2-devel@lists.01.org Cc: Naveen Santhapur ; Ye, Ting = ; Fu, Siyuan ; Wu, Jiaxin Subject: [Patch] NetworkPkg/Dhcp6Dxe: Handle the Nil UUID case Nil UUID is a special case with all zeros value. This patch is to handle th= is case to avoid the invalid DUID. Cc: Naveen Santhapur Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf | 4 +++- NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h | 3 ++- NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf b/NetworkPkg/Dhcp6Dxe/Dhcp6Dx= e.inf index 24cb9a9..40a6ee7 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf @@ -3,11 +3,11 @@ # # This driver produces EFI DHCPv6 Protocol which is used to get IPv6 addr= esses # and other configuration parameters from DHCPv6 servers. # # (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
-# Co= pyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2017, Intel Corporation. All rights=20 +reserved.
# # This program and the accompanying materials # are licensed and made a= vailable under the terms and conditions of the BSD License # which accomp= anies this distribution. The full text of the license may be found at # h= ttp://opensource.org/licenses/bsd-license.php. @@ -72,10 +72,12 @@ gEfiUdp6ProtocolGuid ## TO_START gEfiDhcp6ServiceBindingProtocolGuid ## BY_START gEfiDhcp6ProtocolGuid ## BY_START gEfiIp6ConfigProtocolGuid ## TO_START =20 +[Guids] =20 + gZeroGuid ## SOMETIMES_CONSUMES ## GUID =20 [Pcd] gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType ## SOMETIMES_CONSUMES =20 [UserExtensions.TianoCore."ExtraFiles"] diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h b/NetworkPkg/Dhcp6Dxe/Dhcp6Imp= l.h index 86ef8af..06780b6 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h @@ -1,9 +1,9 @@ /** @file Dhcp6 internal data structure and definition declaration. =20 - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights=20 + reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at http://opensource.org/licenses/bsd-license.php. @@ -35,10 +35,11 @@ #include #include #include #include #include +#include =20 =20 typedef struct _DHCP6_IA_CB DHCP6_IA_CB; typedef struct _DHCP6_INF_CB DHCP6_INF_CB; typedef struct _DHCP6_TX_CB DHCP6_TX_CB; diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c b/NetworkPkg/Dhcp6Dxe/Dhcp6= Utility.c index 2525a32..a65ed6d 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c @@ -1,10 +1,10 @@ /** @file Dhcp6 support functions implementation. =20 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights=20 + reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at http://opensource.org/licenses/bsd-license.php. @@ -62,11 +62,11 @@ Dhcp6GenerateClientId ( // =20 // // If System UUID is found from SMBIOS Table, use DUID-UUID type. // - if ((PcdGet8 (PcdDhcp6UidType) =3D=3D Dhcp6DuidTypeUuid) && !EFI_ERROR (= NetLibGetSystemGuid (&Uuid))) { + if ((PcdGet8 (PcdDhcp6UidType) =3D=3D Dhcp6DuidTypeUuid) && !EFI_ERROR=20 + (NetLibGetSystemGuid (&Uuid)) && !CompareGuid (&Uuid, &gZeroGuid)) { // // // The format of DUID-UUID: // =20 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -- 1.9.5.msysgit.1