diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2022-05-08 15:38:04 +0300 |
---|---|---|
committer | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2022-05-08 15:38:04 +0300 |
commit | e489ddac3840bf66eaa30474dbe4e9a2a2444d75 (patch) | |
tree | d6e23b5c69af8ac5d52a71a363d0252ff7c0673c /accel-pppd/ctrl/l2tp/l2tp.c | |
parent | b75f468e3a366837fdb139dd772eb856b293fbec (diff) | |
download | accel-ppp-e489ddac3840bf66eaa30474dbe4e9a2a2444d75.tar.gz accel-ppp-e489ddac3840bf66eaa30474dbe4e9a2a2444d75.zip |
T60: Implement configurable session-timeout param for all connection types
Diffstat (limited to 'accel-pppd/ctrl/l2tp/l2tp.c')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 8567027d..027d7100 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -93,6 +93,7 @@ static size_t conf_secret_len = 0; static int conf_mppe = MPPE_UNSET; static int conf_dataseq = L2TP_DATASEQ_ALLOW; static int conf_reorder_timeout = 0; +static int conf_session_timeout; static const char *conf_ip_pool; static const char *conf_ipv6_pool; static const char *conf_dpv6_pool; @@ -1813,6 +1814,9 @@ static int l2tp_session_start_data_channel(struct l2tp_sess_t *sess) if (conf_ifname) sess->ppp.ses.ifname_rename = _strdup(conf_ifname); + if (conf_session_timeout) + sess->ppp.ses.session_timeout = conf_session_timeout; + sess->ppp.ses.ctrl = &sess->ctrl; sess->apses_state = APSTATE_INIT; @@ -4972,6 +4976,12 @@ static void load_config(void) conf_dpv6_pool = conf_get_opt("l2tp", "ipv6-pool-delegate"); conf_ifname = conf_get_opt("l2tp", "ifname"); + opt = conf_get_opt("l2tp", "session-timeout"); + if (opt) + conf_session_timeout = atoi(opt); + else + conf_session_timeout = 0; + switch (iprange_check_activation()) { case IPRANGE_DISABLED: log_warn("l2tp: iprange module disabled, improper IP configuration of PPP interfaces may cause kernel soft lockup\n"); |