MdeModulePkg/Ip4Dxe: Ignore duplicated DNS address check
authorJiaxin Wu <jiaxin.wu@intel.com>
Thu, 23 Feb 2017 05:27:18 +0000 (13:27 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Mon, 27 Feb 2017 06:57:11 +0000 (14:57 +0800)
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.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
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: Subramanian Sriram <sriram-s@hpe.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c

index 504f2477da7cc94e400616b58c99ee157419f29b..6c7ac68791c3c3e638731c1d723d6f047496d679 100644 (file)
@@ -705,7 +705,6 @@ Ip4Config2SetDnsServerWorker (
 {\r
   UINTN                 OldIndex;\r
   UINTN                 NewIndex;\r
 {\r
   UINTN                 OldIndex;\r
   UINTN                 NewIndex;\r
-  UINTN                 Index1;\r
   EFI_IPv4_ADDRESS      *OldDns;\r
   EFI_IPv4_ADDRESS      *NewDns;\r
   UINTN                 OldDnsCount;\r
   EFI_IPv4_ADDRESS      *OldDns;\r
   EFI_IPv4_ADDRESS      *NewDns;\r
   UINTN                 OldDnsCount;\r
@@ -747,15 +746,6 @@ Ip4Config2SetDnsServerWorker (
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
-    for (Index1 = NewIndex + 1; Index1 < NewDnsCount; Index1++) {\r
-      if (EFI_IP4_EQUAL (NewDns + NewIndex, NewDns + Index1)) {\r
-        if (Tmp != NULL) {\r
-          FreePool (Tmp);\r
-        }\r
-        return EFI_INVALID_PARAMETER;\r
-      }\r
-    }\r
-\r
     if (OneAdded) {\r
       //\r
       // If any address in the new setting is not in the old settings, skip the\r
     if (OneAdded) {\r
       //\r
       // If any address in the new setting is not in the old settings, skip the\r