Store shorter soft lifetime of in- and outbound SAs only

This commit is contained in:
Martin Willi 2012-06-05 16:16:07 +02:00
parent 7a5f372c57
commit 106b938b6b
1 changed files with 8 additions and 1 deletions

View File

@ -632,7 +632,14 @@ METHOD(child_sa_t, install, status_t,
now = time_monotonic(NULL);
if (lifetime->time.rekey)
{
this->rekey_time = now + lifetime->time.rekey;
if (this->rekey_time)
{
this->rekey_time = min(this->rekey_time, now + lifetime->time.rekey);
}
else
{
this->rekey_time = now + lifetime->time.rekey;
}
}
if (lifetime->time.life)
{