Store shorter soft lifetime of in- and outbound SAs only

This commit is contained in:
Martin Willi
2012-06-08 10:22:03 +02:00
parent 7a5f372c57
commit 106b938b6b
+7
View File
@@ -631,9 +631,16 @@ METHOD(child_sa_t, install, status_t,
now = time_monotonic(NULL); now = time_monotonic(NULL);
if (lifetime->time.rekey) if (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; this->rekey_time = now + lifetime->time.rekey;
} }
}
if (lifetime->time.life) if (lifetime->time.life)
{ {
this->expire_time = now + lifetime->time.life; this->expire_time = now + lifetime->time.life;