ike: Apply retransmission_limit before applying the jitter

This commit is contained in:
Tobias Brunner
2017-05-26 18:16:40 +02:00
parent 8ed3168406
commit 00d547119e
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -362,15 +362,15 @@ METHOD(task_manager_t, retransmit, status_t,
timeout = (uint32_t)(this->retransmit_timeout * 1000.0 *
pow(this->retransmit_base, this->initiating.retransmitted));
if (this->retransmit_limit)
{
timeout = min(timeout, this->retransmit_limit);
}
if (this->retransmit_jitter)
{
max_jitter = (timeout / 100.0) * this->retransmit_jitter;
timeout -= max_jitter * (random() / (RAND_MAX + 1.0));
}
if (this->retransmit_limit)
{
timeout = min(timeout, this->retransmit_limit);
}
}
else
{