summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/sstp
diff options
context:
space:
mode:
authorDmitriyEshenko <dmitriy.eshenko@vyos.io>2022-05-08 15:38:04 +0300
committerDmitriyEshenko <dmitriy.eshenko@vyos.io>2022-05-08 15:38:04 +0300
commite489ddac3840bf66eaa30474dbe4e9a2a2444d75 (patch)
treed6e23b5c69af8ac5d52a71a363d0252ff7c0673c /accel-pppd/ctrl/sstp
parentb75f468e3a366837fdb139dd772eb856b293fbec (diff)
downloadaccel-ppp-e489ddac3840bf66eaa30474dbe4e9a2a2444d75.tar.gz
accel-ppp-e489ddac3840bf66eaa30474dbe4e9a2a2444d75.zip
T60: Implement configurable session-timeout param for all connection types
Diffstat (limited to 'accel-pppd/ctrl/sstp')
-rw-r--r--accel-pppd/ctrl/sstp/sstp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c
index 4b15400..f17db43 100644
--- a/accel-pppd/ctrl/sstp/sstp.c
+++ b/accel-pppd/ctrl/sstp/sstp.c
@@ -169,6 +169,7 @@ static const char *conf_ifname;
static int conf_proxyproto = 0;
static int conf_sndbuf = 0;
static int conf_rcvbuf = 0;
+static int conf_session_timeout;
static int conf_hash_protocol = CERT_HASH_PROTOCOL_SHA1 | CERT_HASH_PROTOCOL_SHA256;
static struct hash_t conf_hash_sha1 = { .len = 0 };
@@ -2401,6 +2402,8 @@ static int sstp_connect(struct triton_md_handler_t *h)
conn->ppp.ses.dpv6_pool_name = _strdup(conf_dpv6_pool);
if (conf_ifname)
conn->ppp.ses.ifname_rename = _strdup(conf_ifname);
+ if (conf_session_timeout)
+ conn->ppp.ses.session_timeout = conf_session_timeout;
sockaddr_ntop(&addr, addr_buf, sizeof(addr_buf), FLAG_NOPORT);
conn->ctrl.calling_station_id = _strdup(addr_buf);
@@ -2843,6 +2846,12 @@ static void load_config(void)
if (opt && atoi(opt) > 0)
conf_rcvbuf = atoi(opt);
+ opt = conf_get_opt("sstp", "session-timeout");
+ if (opt)
+ conf_session_timeout = atoi(opt);
+ else
+ conf_session_timeout = 0;
+
ipmode = (serv.addr.u.sa.sa_family == AF_INET && !conf_proxyproto) ?
iprange_check_activation() : -1;
switch (ipmode) {