/** @file\r
The driver binding and service binding protocol for IP6 driver.\r
\r
- Copyright (c) 2009 - 2016, 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
IN VOID *Context\r
)\r
{\r
+ EFI_STATUS Status;\r
//\r
- // Close the event so it does not get called again.\r
+ // Test if protocol was even found.\r
+ // Notification function will be called at least once.\r
//\r
- gBS->CloseEvent (Event);\r
-\r
- mIpSec2Installed = TRUE;\r
+ Status = gBS->LocateProtocol (&gEfiIpSec2ProtocolGuid, NULL, &mIpSec);\r
+ if (Status == EFI_SUCCESS && mIpSec != NULL) {\r
+ //\r
+ // Close the event so it does not get called again.\r
+ //\r
+ gBS->CloseEvent (Event);\r
\r
- return;\r
+ mIpSec2Installed = TRUE;\r
+ }\r
}\r
\r
/**\r
/** @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
if (!mIpSec2Installed) {\r
goto ON_EXIT;\r
}\r
+ ASSERT (mIpSec != NULL);\r
\r
Packet = *Netbuf;\r
RecycleEvent = NULL;\r
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