summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 (