]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6Impl.c
NetworkPkg/Ip6Dxe: Fix the bug when checking the DataSize
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6Impl.c
index 9b34eceeb71d391d941604aa405ebd931604fc68..c937423428ead45057f149f226bd80fedf9e7acb 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Implementation of EFI_IP6_PROTOCOL protocol interfaces.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
+  Copyright (c) 2009 - 2016, 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
@@ -15,7 +16,7 @@
 \r
 #include "Ip6Impl.h"\r
 \r
-EFI_IPSEC_PROTOCOL    *mIpSec = NULL;\r
+EFI_IPSEC2_PROTOCOL    *mIpSec = NULL;\r
 \r
 EFI_IP6_PROTOCOL mEfiIp6ProtocolTemplete = {\r
   EfiIp6GetModeData,\r
@@ -635,7 +636,7 @@ EfiIp6Configure (
   IpInstance = IP6_INSTANCE_FROM_PROTOCOL (This);\r
   IpSb       = IpInstance->Service;\r
 \r
-  if (IpSb->LinkLocalDadFail) {\r
+  if (IpSb->LinkLocalDadFail && Ip6ConfigData != NULL) {\r
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
@@ -689,7 +690,7 @@ EfiIp6Configure (
     Status = Ip6CleanProtocol (IpInstance);\r
 \r
     //\r
-    // Don't change the state if it is DESTORY, consider the following\r
+    // Don't change the state if it is DESTROY, consider the following\r
     // valid sequence: Mnp is unloaded-->Ip Stopped-->Udp Stopped,\r
     // Configure (ThisIp, NULL). If the state is changed to UNCONFIGED,\r
     // the unload fails miserably.\r
@@ -705,11 +706,6 @@ EfiIp6Configure (
   //\r
   Ip6ServiceConfigMnp (IpInstance->Service, FALSE);\r
 \r
-  //\r
-  // Update the variable data.\r
-  //\r
-  Ip6SetVariableData (IpInstance->Service);\r
-\r
 Exit:\r
   gBS->RestoreTPL (OldTpl);\r
   return Status;\r
@@ -846,7 +842,7 @@ EfiIp6Routes (
   EFI_TPL                   OldTpl;\r
   IP6_SERVICE               *IpSb;\r
 \r
-  if ((This == NULL) || (PrefixLength >= IP6_PREFIX_NUM)) {\r
+  if ((This == NULL) || (PrefixLength > IP6_PREFIX_MAX)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1766,7 +1762,6 @@ EfiIp6Cancel (
   )\r
 {\r
   IP6_PROTOCOL              *IpInstance;\r
-  IP6_SERVICE               *IpSb;\r
   EFI_STATUS                Status;\r
   EFI_TPL                   OldTpl;\r
 \r
@@ -1775,11 +1770,6 @@ EfiIp6Cancel (
   }\r
 \r
   IpInstance = IP6_INSTANCE_FROM_PROTOCOL (This);\r
-  IpSb       = IpInstance->Service;\r
-\r
-  if (IpSb->LinkLocalDadFail) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
 \r
   OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r