From: Jiaxin Wu Date: Fri, 24 Feb 2017 03:16:37 +0000 (+0800) Subject: NetworkPkg/Dhcp6Dxe: Handle the Nil UUID case X-Git-Tag: edk2-stable201903~4493 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=03f9cc20b851ce60f5a629381c288f502eb9432c NetworkPkg/Dhcp6Dxe: Handle the Nil UUID case Nil UUID is a special case with all zeros value. This patch is to handle this 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 Reviewed-by: Ye Ting Reviewed-by: Fu Siyuan --- diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf b/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf index 24cb9a9b64..40a6ee7889 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf @@ -5,7 +5,7 @@ # and other configuration parameters from DHCPv6 servers. # # (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 reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -74,6 +74,8 @@ gEfiDhcp6ProtocolGuid ## BY_START gEfiIp6ConfigProtocolGuid ## TO_START +[Guids] + gZeroGuid ## SOMETIMES_CONSUMES ## GUID [Pcd] gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType ## SOMETIMES_CONSUMES diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h index 86ef8afb29..06780b678a 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h @@ -1,7 +1,7 @@ /** @file Dhcp6 internal data structure and definition declaration. - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -37,6 +37,7 @@ #include #include #include +#include typedef struct _DHCP6_IA_CB DHCP6_IA_CB; diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c index 2525a32ff1..a65ed6d589 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c @@ -2,7 +2,7 @@ Dhcp6 support functions implementation. (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 reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -64,7 +64,7 @@ Dhcp6GenerateClientId ( // // If System UUID is found from SMBIOS Table, use DUID-UUID type. // - if ((PcdGet8 (PcdDhcp6UidType) == Dhcp6DuidTypeUuid) && !EFI_ERROR (NetLibGetSystemGuid (&Uuid))) { + if ((PcdGet8 (PcdDhcp6UidType) == Dhcp6DuidTypeUuid) && !EFI_ERROR (NetLibGetSystemGuid (&Uuid)) && !CompareGuid (&Uuid, &gZeroGuid)) { // // // The format of DUID-UUID: