aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-06-25 14:03:51 +0200
committerMartin Willi <martin@revosec.ch>2013-06-25 14:03:51 +0200
commita65024264379bacc2733282f2b59b8c14e3897c0 (patch)
tree0dac0aaf235a9d1ac227b1829a55e570db8ae3e4 /src
parent72631301eb46a3c7a5b708f04c0be49d665df567 (diff)
downloadstrongswan-a65024264379bacc2733282f2b59b8c14e3897c0.tar.bz2
strongswan-a65024264379bacc2733282f2b59b8c14e3897c0.tar.xz
ikev2: keep the CHILD_SA we delete as initiator in the list to destroy
If the responder not correctly send the correct protocol or SPI in the delete response, we should remove the CHILD_SA regardless.
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/sa/ikev2/tasks/child_delete.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libcharon/sa/ikev2/tasks/child_delete.c b/src/libcharon/sa/ikev2/tasks/child_delete.c
index 8652942ad..9e53d037e 100644
--- a/src/libcharon/sa/ikev2/tasks/child_delete.c
+++ b/src/libcharon/sa/ikev2/tasks/child_delete.c
@@ -177,8 +177,11 @@ static void process_payloads(private_child_delete_t *this, message_t *message)
default:
break;
}
-
- this->child_sas->insert_last(this->child_sas, child_sa);
+ if (this->child_sas->find_first(this->child_sas, NULL,
+ (void**)&child_sa) != SUCCESS)
+ {
+ this->child_sas->insert_last(this->child_sas, child_sa);
+ }
}
spis->destroy(spis);
}
@@ -310,10 +313,6 @@ METHOD(task_t, build_i, status_t,
METHOD(task_t, process_i, status_t,
private_child_delete_t *this, message_t *message)
{
- /* flush the list before adding new SAs */
- this->child_sas->destroy(this->child_sas);
- this->child_sas = linked_list_create();
-
process_payloads(this, message);
DBG1(DBG_IKE, "CHILD_SA closed");
return destroy_and_reestablish(this);