Close IKE_SA directly after sending the delete

This commit is contained in:
Martin Willi
2012-03-20 17:31:22 +01:00
parent 0f5b6c6831
commit 07095794a1
+12 -4
View File
@@ -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;
}