diff options
author | Tobias Brunner <tobias@strongswan.org> | 2013-07-10 11:31:56 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2013-07-17 17:45:17 +0200 |
commit | baa6419ec1fdf07c0d0563f005276ed05eb80a0a (patch) | |
tree | f2c79ac040ff4dab046b532d83a964f2ac04ed01 | |
parent | dc8b083d9fd2c55dec4412fd6116804064d826b6 (diff) | |
download | strongswan-baa6419ec1fdf07c0d0563f005276ed05eb80a0a.tar.bz2 strongswan-baa6419ec1fdf07c0d0563f005276ed05eb80a0a.tar.xz |
kernel-pfroute: Make time that is waited for VIPs to appear configurable
One second might be too short for IPs to appear/disappear, especially on
virtualized hosts.
-rw-r--r-- | man/strongswan.conf.5.in | 3 | ||||
-rw-r--r-- | src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/man/strongswan.conf.5.in b/man/strongswan.conf.5.in index f86e9ea10..4192bc9af 100644 --- a/man/strongswan.conf.5.in +++ b/man/strongswan.conf.5.in @@ -610,6 +610,9 @@ Set MTU of ipsecN device .BR charon.plugins.kernel-netlink.roam_events " [yes]" Whether to trigger roam events when interfaces, addresses or routes change .TP +.BR charon.plugins.kernel-pfroute.vip_wait " [1000]" +Time in ms to wait until virtual IP addresses appear/disappear before failing. +.TP .BR charon.plugins.load-tester Section to configure the load-tester plugin, see LOAD TESTS .TP diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c index 2d0e252ac..011cc1b64 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -247,6 +247,11 @@ struct private_kernel_pfroute_net_t * time of last roam event */ timeval_t last_roam; + + /** + * Time in ms to wait for IP addresses to appear/disappear + */ + int vip_wait; }; /** @@ -852,7 +857,8 @@ METHOD(kernel_net_t, add_ip, status_t, this->mutex->lock(this->mutex); while (!timeout && !get_interface_name(this, vip, NULL)) { - timeout = this->condvar->timed_wait(this->condvar, this->mutex, 1000); + timeout = this->condvar->timed_wait(this->condvar, this->mutex, + this->vip_wait); } this->mutex->unlock(this->mutex); if (timeout) @@ -929,7 +935,8 @@ METHOD(kernel_net_t, del_ip, status_t, this->mutex->lock(this->mutex); while (!timeout && get_interface_name(this, vip, NULL)) { - timeout = this->condvar->timed_wait(this->condvar, this->mutex, 1000); + timeout = this->condvar->timed_wait(this->condvar, this->mutex, + this->vip_wait); } this->mutex->unlock(this->mutex); if (timeout) @@ -1382,6 +1389,8 @@ kernel_pfroute_net_t *kernel_pfroute_net_create() .lock = rwlock_create(RWLOCK_TYPE_DEFAULT), .mutex = mutex_create(MUTEX_TYPE_DEFAULT), .condvar = condvar_create(CONDVAR_TYPE_DEFAULT), + .vip_wait = lib->settings->get_int(lib->settings, + "%s.plugins.kernel-pfroute.vip_wait", 1000, hydra->daemon), ); /* create a PF_ROUTE socket to communicate with the kernel */ |