ikev2: Don't cache response to MID sync request

This commit is contained in:
Tobias Brunner
2017-02-08 15:03:25 +01:00
parent 3abc104f7e
commit fb57904cbf
+11 -1
View File
@@ -818,7 +818,7 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
task_t *task;
message_t *message;
host_t *me, *other;
bool delete = FALSE, hook = FALSE;
bool delete = FALSE, hook = FALSE, mid_sync = FALSE;
ike_sa_id_t *id = NULL;
uint64_t responder_spi = 0;
bool result;
@@ -837,6 +837,10 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
enumerator = array_create_enumerator(this->passive_tasks);
while (enumerator->enumerate(enumerator, (void*)&task))
{
if (task->get_type(task) == TASK_IKE_MID_SYNC)
{
mid_sync = TRUE;
}
switch (task->build(task, message))
{
case SUCCESS:
@@ -909,6 +913,12 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
}
return DESTROY_ME;
}
else if (mid_sync)
{
/* we don't want to resend messages to sync MIDs if requests with the
* previous MID arrive */
clear_packets(this->responding.packets);
}
array_compress(this->passive_tasks);