]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6Input.c
NetworkPkg/Ip6Dxe: fix a bug in IP6 driver for IpSec protocol notify.
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6Input.c
index e53e0874b9b52fa9affbb3eb95fbdf913e6f73b3..6aa55555b81beff046f58cd117282e5a2a701ff8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   IP6 internal functions to process the incoming packets.\r
 \r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -530,6 +530,7 @@ Ip6IpSecProcessPacket (
   if (!mIpSec2Installed) {\r
     goto ON_EXIT;\r
   }\r
+  ASSERT (mIpSec != NULL);\r
   \r
   Packet        = *Netbuf;\r
   RecycleEvent  = NULL;\r
@@ -541,17 +542,6 @@ Ip6IpSecProcessPacket (
   FragmentCount = Packet->BlockOpNum;\r
   ZeroMem (&ZeroHead, sizeof (EFI_IP6_HEADER));\r
 \r
-  if (mIpSec == NULL) {\r
-    gBS->LocateProtocol (&gEfiIpSec2ProtocolGuid, NULL, (VOID **) &mIpSec);\r
-\r
-    //\r
-    // Check whether the ipsec protocol is available.\r
-    //\r
-    if (mIpSec == NULL) {\r
-      goto ON_EXIT;\r
-    }\r
-  }\r
-\r
   //\r
   // Check whether the ipsec enable variable is set.\r
   //\r