]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
MdePkg/SmmIoLib: Add header file.
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6ConfigImpl.c
index 75ecec1f32c561e935ba23b5c0ddd92de09e4475..7575b7947d9989d724ff590abe117b0ce73eb596 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of EFI IPv6 Configuration Protocol.\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
@@ -121,7 +121,7 @@ Ip6ConfigOnPolicyChanged (
 \r
   if (NewPolicy == Ip6ConfigPolicyAutomatic) {\r
     //\r
-    // Set paramters to trigger router solicitation sending in timer handler.\r
+    // Set parameters to trigger router solicitation sending in timer handler.\r
     //\r
     IpSb->RouterAdvertiseReceived = FALSE;\r
     IpSb->SolicitTimer            = IP6_MAX_RTR_SOLICITATIONS;\r
@@ -784,6 +784,10 @@ Ip6ManualAddrDadCallback (
   Item       = &Instance->DataItem[Ip6ConfigDataTypeManualAddress];\r
   ManualAddr = NULL;\r
 \r
+  if (Item->DataSize == 0) {\r
+    return;\r
+  }\r
+\r
   for (Index = 0; Index < Item->DataSize / sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS); Index++) {\r
     //\r
     // Find the original tag used to place into the NET_MAP.\r
@@ -1327,7 +1331,6 @@ Ip6ConfigSetDnsServer (
 {\r
   UINTN                 OldIndex;\r
   UINTN                 NewIndex;\r
-  UINTN                 Index1;\r
   EFI_IPv6_ADDRESS      *OldDns;\r
   EFI_IPv6_ADDRESS      *NewDns;\r
   UINTN                 OldDnsCount;\r
@@ -1366,15 +1369,10 @@ Ip6ConfigSetDnsServer (
       //\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_IP6_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
@@ -1434,11 +1432,12 @@ Ip6ConfigInitIfInfo (
   OUT EFI_IP6_CONFIG_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->Ip6ConfigInstance.IfIndex);\r
-  IfInfo->Name[4] = 0;\r
+  UnicodeSPrint (\r
+    IfInfo->Name,\r
+    sizeof (IfInfo->Name),\r
+    L"eth%d",\r
+    IpSb->Ip6ConfigInstance.IfIndex\r
+  );\r
 \r
   IfInfo->IfType        = IpSb->SnpMode.IfType;\r
   IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;\r