aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-03-13 12:15:25 +0100
committerTobias Brunner <tobias@strongswan.org>2017-05-23 18:05:58 +0200
commit70855696adb5bf363c0b91af0af9fe09db4a9e6c (patch)
tree8777d914191845d0a380fb276a8cabc4eada0051 /src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c
parentbfbd3af8506052fa3a331bd151453795913d3645 (diff)
downloadstrongswan-70855696adb5bf363c0b91af0af9fe09db4a9e6c.tar.bz2
strongswan-70855696adb5bf363c0b91af0af9fe09db4a9e6c.tar.xz
kernel-netlink: Use total retransmit timeout as acquire timeout
By using the total retransmit timeout, modifications of timeout settings automatically reflect on the value of xfrm_acq_expires. If set, the value of xfrm_acq_expires configured by the user takes precedence over the calculated value.
Diffstat (limited to 'src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c')
-rw-r--r--src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c b/src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c
index 8bafc3c55..58350028f 100644
--- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c
+++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_plugin.c
@@ -19,6 +19,8 @@
#include "kernel_netlink_ipsec.h"
#include "kernel_netlink_net.h"
+#include <sa/task_manager.h>
+
typedef struct private_kernel_netlink_plugin_t private_kernel_netlink_plugin_t;
/**
@@ -50,6 +52,24 @@ METHOD(plugin_t, get_features, int,
return countof(f);
}
+METHOD(plugin_t, reload, bool,
+ private_kernel_netlink_plugin_t *this)
+{
+ u_int timeout;
+ FILE *f;
+
+ f = fopen("/proc/sys/net/core/xfrm_acq_expires", "w");
+ if (f)
+ {
+ timeout = lib->settings->get_int(lib->settings,
+ "%s.plugins.kernel-netlink.xfrm_acq_expires",
+ task_manager_total_retransmit_timeout(), lib->ns);
+ fprintf(f, "%u", timeout);
+ fclose(f);
+ }
+ return TRUE;
+}
+
METHOD(plugin_t, destroy, void,
private_kernel_netlink_plugin_t *this)
{
@@ -76,10 +96,13 @@ plugin_t *kernel_netlink_plugin_create()
.plugin = {
.get_name = _get_name,
.get_features = _get_features,
+ .reload = _reload,
.destroy = _destroy,
},
},
);
+ reload(this);
+
return &this->public.plugin;
}