/** @file\r
IP6 internal functions to process the incoming packets.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2011, 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
ZeroMem (&ZeroHead, sizeof (EFI_IP6_HEADER));\r
\r
if (mIpSec == NULL) {\r
- gBS->LocateProtocol (&gEfiIpSecProtocolGuid, NULL, (VOID **) &mIpSec);\r
+ gBS->LocateProtocol (&gEfiIpSec2ProtocolGuid, NULL, (VOID **) &mIpSec);\r
\r
//\r
// Check whether the ipsec protocol is available.\r
Ip6NtohHead (*Head);\r
\r
if (EFI_ERROR (Status)) {\r
+ FreePool (OriginalFragmentTable);\r
goto ON_EXIT;\r
}\r
\r
//\r
// For ByPass Packet\r
//\r
+ FreePool (FragmentTable);\r
goto ON_EXIT;\r
+ } else {\r
+ //\r
+ // Free the FragmentTable which allocated before calling the IPsec.\r
+ //\r
+ FreePool (OriginalFragmentTable);\r
}\r
\r
if (Direction == EfiIPsecOutBound && TxWrap != NULL) {\r
TxWrap\r
);\r
if (TxWrap->Packet == NULL) {\r
+ TxWrap->Packet = *Netbuf;\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
IpSecWrap = AllocateZeroPool (sizeof (IP6_IPSEC_WRAP));\r
\r
if (IpSecWrap == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ gBS->SignalEvent (RecycleEvent);\r
goto ON_EXIT;\r
}\r
\r
);\r
\r
if (Packet == NULL) {\r
+ Packet = IpSecWrap->Packet;\r
+ gBS->SignalEvent (RecycleEvent);\r
+ FreePool (IpSecWrap);\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
NET_BUF_HEAD\r
);\r
if (PacketHead == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
+ *Netbuf = Packet;\r
+ Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
\r