aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2008-09-03 18:49:06 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2008-09-03 18:49:06 +0000
commit3dfecde4c0b31cddf3f9497a87a31e6c7245ae65 (patch)
treefde1d2d1d2b1f815698c5e2eb5fdced802facc14 /src
parent6283b1f1f8c85ee91284b3215253cf1bb3958b09 (diff)
downloadstrongswan-3dfecde4c0b31cddf3f9497a87a31e6c7245ae65.tar.bz2
strongswan-3dfecde4c0b31cddf3f9497a87a31e6c7245ae65.tar.xz
configure NAT keep alive interval using the charon.keep_alive key
Diffstat (limited to 'src')
-rw-r--r--src/charon/sa/ike_sa.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/charon/sa/ike_sa.c b/src/charon/sa/ike_sa.c
index 563a43a86..3cf52fc36 100644
--- a/src/charon/sa/ike_sa.c
+++ b/src/charon/sa/ike_sa.c
@@ -260,6 +260,11 @@ struct private_ike_sa_t {
u_int32_t pending_updates;
/**
+ * NAT keep alive interval
+ */
+ u_int32_t keepalive_interval;
+
+ /**
* Timestamps for this IKE_SA
*/
struct {
@@ -469,7 +474,7 @@ static void send_keepalive(private_ike_sa_t *this)
diff = now - last_out;
- if (diff >= KEEPALIVE_INTERVAL)
+ if (diff >= this->keepalive_interval)
{
packet_t *packet;
chunk_t data;
@@ -487,7 +492,7 @@ static void send_keepalive(private_ike_sa_t *this)
}
job = send_keepalive_job_create(this->ike_sa_id);
charon->scheduler->schedule_job(charon->scheduler, (job_t*)job,
- (KEEPALIVE_INTERVAL - diff) * 1000);
+ (this->keepalive_interval - diff) * 1000);
}
/**
@@ -2616,6 +2621,8 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id)
this->skp_build = chunk_empty;
this->child_prf = NULL;
this->state = IKE_CREATED;
+ this->keepalive_interval = lib->settings->get_int(lib->settings,
+ "charon.keep_alive", KEEPALIVE_INTERVAL);
this->time.inbound = this->time.outbound = time(NULL);
this->time.established = 0;
this->time.rekey = 0;