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.
This commit is contained in:
Tobias Brunner
2017-05-23 18:05:58 +02:00
parent bfbd3af850
commit 70855696ad
3 changed files with 26 additions and 16 deletions
@@ -78,9 +78,6 @@
/** Base priority for installed policies */
#define PRIO_BASE 200000
/** Default lifetime of an acquire XFRM state (in seconds) */
#define DEFAULT_ACQUIRE_LIFETIME 165
/**
* Map the limit for bytes and packets to XFRM_INF by default
*/
@@ -3231,7 +3228,6 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
{
private_kernel_netlink_ipsec_t *this;
bool register_for_events = TRUE;
FILE *f;
INIT(this,
.public = {
@@ -3276,15 +3272,6 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
register_for_events = FALSE;
}
f = fopen("/proc/sys/net/core/xfrm_acq_expires", "w");
if (f)
{
fprintf(f, "%u", lib->settings->get_int(lib->settings,
"%s.plugins.kernel-netlink.xfrm_acq_expires",
DEFAULT_ACQUIRE_LIFETIME, lib->ns));
fclose(f);
}
this->socket_xfrm = netlink_socket_create(NETLINK_XFRM, xfrm_msg_names,
lib->settings->get_bool(lib->settings,
"%s.plugins.kernel-netlink.parallel_xfrm", FALSE, lib->ns));