Having duplicated DNS server IPs specified is not an ideal
configuration, but not an error condition. This patch is to
remove the duplicated DNS address check to allow the same DNS
address setting in SetData().

Cc: Hegde Nagaraj P <nagaraj-p.he...@hpe.com>
Cc: Subramanian Sriram <srira...@hpe.com>
Cc: Ye Ting <ting...@intel.com>
Cc: Fu Siyuan <siyuan...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
---
 NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c 
b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
index e309b69..67037bb 100644
--- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
+++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
@@ -1325,11 +1325,10 @@ Ip6ConfigSetDnsServer (
   IN VOID                 *Data
   )
 {
   UINTN                 OldIndex;
   UINTN                 NewIndex;
-  UINTN                 Index1;
   EFI_IPv6_ADDRESS      *OldDns;
   EFI_IPv6_ADDRESS      *NewDns;
   UINTN                 OldDnsCount;
   UINTN                 NewDnsCount;
   IP6_CONFIG_DATA_ITEM  *Item;
@@ -1370,19 +1369,10 @@ Ip6ConfigSetDnsServer (
         FreePool (Tmp);
       }
       return EFI_INVALID_PARAMETER;
     }
 
-    for (Index1 = NewIndex + 1; Index1 < NewDnsCount; Index1++) {
-      if (EFI_IP6_EQUAL (NewDns + NewIndex, NewDns + Index1)) {
-        if (Tmp != NULL) {
-          FreePool (Tmp);
-        }
-        return EFI_INVALID_PARAMETER;
-      }
-    }
-
     if (OneAdded) {
       //
       // If any address in the new setting is not in the old settings, skip the
       // comparision below.
       //
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to