The patch is good to me. Reviewed-by: Fu Siyuan <siyuan...@intel.com>
-----Original Message----- From: Samer El-Haj-Mahmoud [mailto:samer.el-haj-mahm...@hp.com] Sent: Sunday, June 28, 2015 6:20 AM To: edk2-devel@lists.sourceforge.net Cc: Samer El-Haj-Mahmoud Subject: [edk2] [PATCH] NetworkPkg: Add IPv6 DUID configuration support using platform PCD From: Samer El-Haj-Mahmoud <el...@hp.com> The code today always uses DUID-UUID unless there is an error in reading the UUID, which results in falling through to DUID-LLT. This change allows the platform to control the DUID method (DUID-UUID or DUID-LLT) using a platform dynamic PCD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <el...@hp.com> --- NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf | 6 ++++++ NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c | 3 ++- NetworkPkg/NetworkPkg.dec | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf b/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf index 5c79237..d53ce67 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf @@ -4,6 +4,7 @@ # This driver produces EFI DHCPv6 Protocol which is used to get IPv6 addresses # and other configuration parameters from DHCPv6 servers. # +# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials @@ -51,6 +52,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec + NetworkPkg/NetworkPkg.dec [LibraryClasses] @@ -73,5 +75,9 @@ gEfiDhcp6ProtocolGuid ## BY_START gEfiIp6ConfigProtocolGuid ## TO_START + +[Pcd] + gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType + [UserExtensions.TianoCore."ExtraFiles"] Dhcp6DxeExtra.uni diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c index e3349ee..2525a32 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c @@ -1,6 +1,7 @@ /** @file Dhcp6 support functions implementation. + (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials @@ -63,7 +64,7 @@ Dhcp6GenerateClientId ( // // If System UUID is found from SMBIOS Table, use DUID-UUID type. // - if (!EFI_ERROR (NetLibGetSystemGuid (&Uuid))) { + if ((PcdGet8 (PcdDhcp6UidType) == Dhcp6DuidTypeUuid) && !EFI_ERROR + (NetLibGetSystemGuid (&Uuid))) { // // // The format of DUID-UUID: diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec index 6515844..f19684d 100644 --- a/NetworkPkg/NetworkPkg.dec +++ b/NetworkPkg/NetworkPkg.dec @@ -3,6 +3,7 @@ # # This package provides network modules that conform to UEFI 2.4 specification. # +# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available under @@ -68,5 +69,13 @@ # @Prompt Private Key's size. gEfiNetworkPkgTokenSpaceGuid.PcdIpsecUefiCertificateKeySize|0x3d5|UINT32|0x00000006 +[PcdsDynamicEx] + ## IPv6 DHCP Unique Identifier (DUID) Type configuration (From RFCs 3315 and 6355). + # 01 = DUID Based on Link-layer Address Plus Time [DUID-LLT] + # 04 = UUID-Based DHCPv6 Unique Identifier (DUID-UUID) + # 02 = DUID Assigned by Vendor Based on Enterprise Number [DUID-EN] (not supported) + # 03 = DUID Based on Link-layer Address [DUID-LL] (not supported) + gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType|4|UINT8|0x10000001 + [UserExtensions.TianoCore."ExtraFiles"] NetworkPkgExtra.uni -- 1.9.5.msysgit.0 ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel