diff options
author | Martin Willi <martin@revosec.ch> | 2011-12-14 15:33:06 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-03-20 17:31:22 +0100 |
commit | 07095794a1ecee5b084c5b69f7d5a9fefd737c9e (patch) | |
tree | 38bfa25283e2a12a8e31619918fbfabb64fef2e1 | |
parent | 0f5b6c6831e85d31fc75dece62fed3a14858a857 (diff) | |
download | strongswan-07095794a1ecee5b084c5b69f7d5a9fefd737c9e.tar.bz2 strongswan-07095794a1ecee5b084c5b69f7d5a9fefd737c9e.tar.xz |
Close IKE_SA directly after sending the delete
-rwxr-xr-x | src/libcharon/sa/task_manager_v1.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libcharon/sa/task_manager_v1.c b/src/libcharon/sa/task_manager_v1.c index bdb55a07e..494fe84c3 100755 --- a/src/libcharon/sa/task_manager_v1.c +++ b/src/libcharon/sa/task_manager_v1.c @@ -462,11 +462,19 @@ METHOD(task_manager_t, initiate, status_t, this->initiating.packet->destroy(this->initiating.packet); this->initiating.packet = NULL; - /* close after sending an INFORMATIONAL error but not yet established */ - if (exchange == INFORMATIONAL_V1 && - this->ike_sa->get_state(this->ike_sa) == IKE_CONNECTING) + if (exchange == INFORMATIONAL_V1) { - return FAILED; + switch (this->ike_sa->get_state(this->ike_sa)) + { + case IKE_CONNECTING: + /* close after sending an INFORMATIONAL when unestablished */ + return FAILED; + case IKE_DELETING: + /* close after sending a DELETE */ + return DESTROY_ME; + default: + break; + } } return SUCCESS; } |