ike: Only track actually sent retransmits as outbound packets

Retransmission jobs for old requests for which we already received a
response previously left the impression that messages were sent more
recently than was actually the case.

task_manager_t always defined INVALID_STATE as possible return value if
no retransmit was sent, this just was never actually returned.

I guess we could further differentiate between actual invalid states
(e.g. if we already received the response) and when we don't send a
retransmit for other reasons e.g. because the IKE_SA became stale.
This commit is contained in:
Tobias Brunner
2020-06-02 14:07:06 +02:00
parent f3695d089b
commit 2edc73d84e
4 changed files with 88 additions and 81 deletions
+4 -3
View File
@@ -409,7 +409,7 @@ METHOD(task_manager_t, retransmit, status_t,
"deferred");
this->ike_sa->set_condition(this->ike_sa, COND_STALE, TRUE);
this->initiating.deferred = TRUE;
return SUCCESS;
return INVALID_STATE;
}
else if (mobike->is_probing(mobike))
{
@@ -443,7 +443,7 @@ METHOD(task_manager_t, retransmit, status_t,
"deferred");
this->ike_sa->set_condition(this->ike_sa, COND_STALE, TRUE);
this->initiating.deferred = TRUE;
return SUCCESS;
return INVALID_STATE;
}
}
@@ -451,8 +451,9 @@ METHOD(task_manager_t, retransmit, status_t,
job = (job_t*)retransmit_job_create(this->initiating.mid,
this->ike_sa->get_id(this->ike_sa));
lib->scheduler->schedule_job_ms(lib->scheduler, job, timeout);
return SUCCESS;
}
return SUCCESS;
return INVALID_STATE;
}
METHOD(task_manager_t, initiate, status_t,