summaryrefslogtreecommitdiff
path: root/NetworkPkg/Ip6Dxe
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/Ip6Dxe')
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Driver.c38
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Impl.h2
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Input.c6
3 files changed, 46 insertions, 0 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
index 6958784..4fde476 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -2,6 +2,7 @@
The driver binding and service binding protocol for IP6 driver.
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -24,6 +25,33 @@ EFI_DRIVER_BINDING_PROTOCOL gIp6DriverBinding = {
NULL
};
+BOOLEAN mIpSec2Installed = FALSE;
+
+/**
+ Callback function for IpSec2 Protocol install.
+
+ @param[in] Event Event whose notification function is being invoked
+ @param[in] Context Pointer to the notification function's context
+
+ @retval EFI_SUCCESS Callback successful.
+**/
+VOID
+EFIAPI
+IpSec2InstalledCallback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ //
+ // Close the event so it does not get called again.
+ //
+ gBS->CloseEvent (Event);
+
+ mIpSec2Installed = TRUE;
+
+ return;
+}
+
/**
This is the declaration of an EFI image entry point. This entry point is
the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
@@ -46,6 +74,16 @@ Ip6DriverEntryPoint (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
+ VOID *Registration;
+
+ EfiCreateProtocolNotifyEvent (
+ &gEfiIpSec2ProtocolGuid,
+ TPL_CALLBACK,
+ IpSec2InstalledCallback,
+ NULL,
+ &Registration
+ );
+
return EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
SystemTable,
diff --git a/NetworkPkg/Ip6Dxe/Ip6Impl.h b/NetworkPkg/Ip6Dxe/Ip6Impl.h
index 8f114bb..d30246b 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Impl.h
+++ b/NetworkPkg/Ip6Dxe/Ip6Impl.h
@@ -2,6 +2,7 @@
Implementation of EFI_IP6_PROTOCOL protocol interfaces and type definitions.
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -89,6 +90,7 @@
#define IP6_NO_MAPPING(IpInstance) (!(IpInstance)->Interface->Configured)
extern EFI_IPSEC2_PROTOCOL *mIpSec;
+extern BOOLEAN mIpSec2Installed;
//
// IP6_TXTOKEN_WRAP wraps the upper layer's transmit token.
diff --git a/NetworkPkg/Ip6Dxe/Ip6Input.c b/NetworkPkg/Ip6Dxe/Ip6Input.c
index cf88884..e53e087 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Input.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Input.c
@@ -2,6 +2,7 @@
IP6 internal functions to process the incoming packets.
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -525,6 +526,11 @@ Ip6IpSecProcessPacket (
EFI_IP6_HEADER ZeroHead;
Status = EFI_SUCCESS;
+
+ if (!mIpSec2Installed) {
+ goto ON_EXIT;
+ }
+
Packet = *Netbuf;
RecycleEvent = NULL;
IpSecWrap = NULL;