]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
MdeModulePkg/Ip4Dxe: Ignore duplicated DNS address check
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Config2Impl.c
index 5b01b35b760e71c59d43625c1b4b9e779410df2e..6c7ac68791c3c3e638731c1d723d6f047496d679 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of EFI IPv4 Configuration II Protocol.\r
 \r
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
 \r
   This program and the accompanying materials\r
@@ -705,7 +705,6 @@ Ip4Config2SetDnsServerWorker (
 {\r
   UINTN                 OldIndex;\r
   UINTN                 NewIndex;\r
-  UINTN                 Index1;\r
   EFI_IPv4_ADDRESS      *OldDns;\r
   EFI_IPv4_ADDRESS      *NewDns;\r
   UINTN                 OldDnsCount;\r
@@ -741,15 +740,10 @@ Ip4Config2SetDnsServerWorker (
       //\r
       // The dns server address must be unicast.\r
       //\r
-      FreePool (Tmp);\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
-        return EFI_INVALID_PARAMETER;\r
       }\r
+      return EFI_INVALID_PARAMETER;\r
     }\r
 \r
     if (OneAdded) {\r
@@ -1282,21 +1276,17 @@ Ip4Config2SetMaunualAddress (
 \r
   IpSb->Reconfig = TRUE;\r
   Status = Ip4Config2SetDefaultAddr (IpSb, StationAddress, SubnetMask);\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_EXIT;\r
-  }  \r
 \r
-  DataItem->Status = EFI_SUCCESS;   \r
+  DataItem->Status = Status; \r
 \r
-ON_EXIT:\r
-  if (EFI_ERROR (DataItem->Status)) {\r
+  if (EFI_ERROR (DataItem->Status) && DataItem->Status != EFI_NOT_READY) {\r
     if (Ptr != NULL) {\r
       FreePool (Ptr);\r
     }\r
     DataItem->Data.Ptr = NULL; \r
   }\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -1492,11 +1482,12 @@ Ip4Config2InitIfInfo (
   OUT EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo\r
   )\r
 {\r
-  IfInfo->Name[0] = L'e';\r
-  IfInfo->Name[1] = L't';\r
-  IfInfo->Name[2] = L'h';\r
-  IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip4Config2Instance.IfIndex);\r
-  IfInfo->Name[4] = 0;\r
+  UnicodeSPrint (\r
+    IfInfo->Name,\r
+    EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE,\r
+    L"eth%d",\r
+    IpSb->Ip4Config2Instance.IfIndex\r
+  );\r
 \r
   IfInfo->IfType        = IpSb->SnpMode.IfType;\r
   IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;\r