]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/Dhcp6Dxe: Handle the Nil UUID case
authorJiaxin Wu <jiaxin.wu@intel.com>
Fri, 24 Feb 2017 03:16:37 +0000 (11:16 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Mon, 6 Mar 2017 00:32:04 +0000 (08:32 +0800)
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 <naveens@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h
NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c

index 24cb9a9b644680198e6e29a00cc192a9f8c768f2..40a6ee788991fd2e1d6cec829cf405864e1a7cdf 100644 (file)
@@ -5,7 +5,7 @@
 #  and other configuration parameters from DHCPv6 servers.\r
 #\r
 #  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -74,6 +74,8 @@
   gEfiDhcp6ProtocolGuid                              ## BY_START\r
   gEfiIp6ConfigProtocolGuid                          ## TO_START\r
 \r
+[Guids]  \r
+  gZeroGuid                   ## SOMETIMES_CONSUMES   ## GUID\r
  \r
 [Pcd]\r
   gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType       ## SOMETIMES_CONSUMES\r
index 86ef8afb292263428ae7510875354015013d2fb8..06780b678a434d67226314d07f5be098495c77a8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Dhcp6 internal data structure and definition declaration.\r
 \r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -37,6 +37,7 @@
 #include <Library/BaseLib.h>\r
 #include <Library/NetLib.h>\r
 #include <Library/PrintLib.h>\r
+#include <Guid/ZeroGuid.h>\r
 \r
 \r
 typedef struct _DHCP6_IA_CB    DHCP6_IA_CB;\r
index 2525a32ff1e822c3bf3a40d8cee5428d3ded5f6c..a65ed6d5892b59c861ab6181e632b67a37a6413d 100644 (file)
@@ -2,7 +2,7 @@
   Dhcp6 support functions implementation.\r
 \r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -64,7 +64,7 @@ Dhcp6GenerateClientId (
   //\r
   // If System UUID is found from SMBIOS Table, use DUID-UUID type.\r
   //\r
-  if ((PcdGet8 (PcdDhcp6UidType) == Dhcp6DuidTypeUuid) && !EFI_ERROR (NetLibGetSystemGuid (&Uuid))) {\r
+  if ((PcdGet8 (PcdDhcp6UidType) == Dhcp6DuidTypeUuid) && !EFI_ERROR (NetLibGetSystemGuid (&Uuid)) && !CompareGuid (&Uuid, &gZeroGuid)) {\r
     //\r
     //\r
     //  The format of DUID-UUID:\r