From 106b938b6bc665b01973f0977743be15db77b80d Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 5 Jun 2012 16:16:07 +0200 Subject: [PATCH] Store shorter soft lifetime of in- and outbound SAs only --- src/libcharon/sa/child_sa.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libcharon/sa/child_sa.c b/src/libcharon/sa/child_sa.c index 76ccceec23..d5adb25275 100644 --- a/src/libcharon/sa/child_sa.c +++ b/src/libcharon/sa/child_sa.c @@ -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) { -- 2.47.2