]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
NetworkPkg: Fix typo.
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6ConfigImpl.c
index 8b389772d9715a388b90e689f9fab44d35935be3..9a1e3d076f6a021829a8b28310a5ae828fca7be3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of EFI IPv6 Configuration Protocol.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2014, 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
@@ -473,7 +473,7 @@ Ip6ConfigWriteConfigData (
 \r
       DataRecord           = &Variable->DataRecord[Variable->DataRecordCount];\r
       DataRecord->DataType = (EFI_IP6_CONFIG_DATA_TYPE) Index;\r
-      DataRecord->DataSize = DataItem->DataSize;\r
+      DataRecord->DataSize = (UINT32) DataItem->DataSize;\r
       DataRecord->Offset   = (UINT16) (Heap - (CHAR8 *) Variable);\r
 \r
       Variable->DataRecordCount++;\r
@@ -1012,6 +1012,14 @@ Ip6ConfigSetMaunualAddress (
         128\r
         );\r
 \r
+      //\r
+      // If the new address's prefix length is not specified, just use the previous configured\r
+      // prefix length for this address.\r
+      //\r
+      if (NewAddress->PrefixLength == 0) {\r
+        NewAddress->PrefixLength = CurrentAddrInfo->PrefixLength;\r
+      }\r
+\r
       //\r
       // This manual address is already in use, see whether prefix length is changed.\r
       //\r
@@ -1594,11 +1602,13 @@ Ip6ConfigSetStatefulAddrCallback (
       //\r
       // Decline those duplicates.\r
       //\r
-      Instance->Dhcp6->Decline (\r
-                         Instance->Dhcp6,\r
-                         Instance->DeclineAddressCount,\r
-                         Instance->DeclineAddress\r
-                         );\r
+      if (Instance->Dhcp6 != NULL) {\r
+        Instance->Dhcp6->Decline (\r
+                           Instance->Dhcp6,\r
+                           Instance->DeclineAddressCount,\r
+                           Instance->DeclineAddress\r
+                           );\r
+      }\r
     }\r
 \r
     if (Instance->DeclineAddress != NULL) {\r
@@ -2316,12 +2326,12 @@ Ip6ConfigCleanInstance (
 }\r
 \r
 /**\r
-  Destory the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources.\r
+  Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources.\r
 \r
   @param[in, out] Instance    The buffer of IP6_CONFIG_INSTANCE to be freed.\r
 \r
   @retval EFI_SUCCESS         The child was successfully destroyed.\r
-  @retval Others              Failed to destory the child.\r
+  @retval Others              Failed to destroy the child.\r
 \r
 **/\r
 EFI_STATUS\r