ikev2: Don't cache response to MID sync request
This commit is contained in:
@@ -818,7 +818,7 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
|
|||||||
task_t *task;
|
task_t *task;
|
||||||
message_t *message;
|
message_t *message;
|
||||||
host_t *me, *other;
|
host_t *me, *other;
|
||||||
bool delete = FALSE, hook = FALSE;
|
bool delete = FALSE, hook = FALSE, mid_sync = FALSE;
|
||||||
ike_sa_id_t *id = NULL;
|
ike_sa_id_t *id = NULL;
|
||||||
uint64_t responder_spi = 0;
|
uint64_t responder_spi = 0;
|
||||||
bool result;
|
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);
|
enumerator = array_create_enumerator(this->passive_tasks);
|
||||||
while (enumerator->enumerate(enumerator, (void*)&task))
|
while (enumerator->enumerate(enumerator, (void*)&task))
|
||||||
{
|
{
|
||||||
|
if (task->get_type(task) == TASK_IKE_MID_SYNC)
|
||||||
|
{
|
||||||
|
mid_sync = TRUE;
|
||||||
|
}
|
||||||
switch (task->build(task, message))
|
switch (task->build(task, message))
|
||||||
{
|
{
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
@@ -909,6 +913,12 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
|
|||||||
}
|
}
|
||||||
return DESTROY_ME;
|
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);
|
array_compress(this->passive_tasks);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user