summaryrefslogtreecommitdiff
path: root/NetworkPkg/IpSecDxe
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2015-08-28 08:37:19 +0000
committerhwu1225 <hwu1225@Edk2>2015-08-28 08:37:19 +0000
commit727048b5fc68382dad540f2a8548d29905e38278 (patch)
tree20c4ae48f8492a2a3f7842d1808792bb4426e5c6 /NetworkPkg/IpSecDxe
parent889f1f4cffe3889074d26bc53e2484784c760844 (diff)
downloadedk2-platforms-727048b5fc68382dad540f2a8548d29905e38278.tar.xz
NetworkPkg: Fix IpSec run into infinite loop issue in some case
v2: * Update the copyright year and conditional judgment for removing. When edit one SPEntry in SPD database, the corresponding SA entry will be updated to the sas list of the new SPD entry. But before that, all of them should be removed from the original sas list. If not, the list will be broken into infinite loop. (Sync patch r18352 from main trunk.) Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18361 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/IpSecDxe')
-rw-r--r--NetworkPkg/IpSecDxe/IpSecConfigImpl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/NetworkPkg/IpSecDxe/IpSecConfigImpl.c b/NetworkPkg/IpSecDxe/IpSecConfigImpl.c
index 6eabfe45de..bd49245190 100644
--- a/NetworkPkg/IpSecDxe/IpSecConfigImpl.c
+++ b/NetworkPkg/IpSecDxe/IpSecConfigImpl.c
@@ -1,7 +1,7 @@
/** @file
The implementation of IPSEC_CONFIG_PROTOCOL.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -1199,6 +1199,9 @@ SetSpdEntry (
(EFI_IPSEC_CONFIG_SELECTOR *) &SpdData->SaId[Index],
(EFI_IPSEC_CONFIG_SELECTOR *) SadEntry->Id
)) {
+ if (SadEntry->Data->SpdEntry != NULL) {
+ RemoveEntryList (&SadEntry->BySpd);
+ }
InsertTailList (&SpdEntry->Data->Sas, &SadEntry->BySpd);
SadEntry->Data->SpdEntry = SpdEntry;
DuplicateSpdSelector (