]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c
MdeModulePkg/Ip4Dxe: fix a bug in IP4 driver for IpSec protocol notify.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Input.c
index 09b8f2bac23554b5f759d78630c58025fd61e23f..e6943230195cb6e056c132e214e483206817a6ba 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   IP4 input process.\r
   \r
-Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 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
@@ -518,6 +518,7 @@ Ip4IpSecProcessPacket (
   if (!mIpSec2Installed) {\r
     goto ON_EXIT;\r
   }\r
+  ASSERT (mIpSec != NULL);\r
   \r
   Packet        = *Netbuf;\r
   RecycleEvent  = NULL;\r
@@ -527,13 +528,6 @@ Ip4IpSecProcessPacket (
   FragmentCount = Packet->BlockOpNum;\r
 \r
   ZeroMem (&ZeroHead, sizeof (IP4_HEAD));\r
-  \r
-  if (mIpSec == NULL) {\r
-    gBS->LocateProtocol (&gEfiIpSec2ProtocolGuid, NULL, (VOID **) &mIpSec);\r
-    if (mIpSec == NULL) {\r
-      goto ON_EXIT;\r
-    }\r
-  }\r
 \r
   //\r
   // Check whether the IPsec enable variable is set.\r