summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2015-02-21 14:34:01 +0300
committerDmitry Kozlov <xeb@mail.ru>2015-02-21 14:34:01 +0300
commit44d9afd7f6f1b066cc1450a89c0bf43df3804d44 (patch)
tree71e83c402ccb2d40fe2637f8cdf297d6687c88f2 /accel-pppd
parent9cafdf7bf0676179a40c11863666b1b6bc8f3403 (diff)
downloadaccel-ppp-44d9afd7f6f1b066cc1450a89c0bf43df3804d44.tar.gz
accel-ppp-44d9afd7f6f1b066cc1450a89c0bf43df3804d44.zip
ipoe: introduced "idle-timeout" and "session-timeout" options
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/accel-ppp.conf2
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf
index 7186bff7..7b534619 100644
--- a/accel-pppd/accel-ppp.conf
+++ b/accel-pppd/accel-ppp.conf
@@ -132,6 +132,8 @@ start=dhcpv4
#vlan-timeout=60
#vlan-name=%I.%N
#ip-pool=ipoe
+#idle-timeout=0
+#session-timeout=0
interface=eth0
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 6c1953b3..0764b200 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -126,6 +126,8 @@ static int conf_l4_redirect_on_reject;
static const char *conf_l4_redirect_ipset;
static int conf_vlan_timeout = 30;
static int conf_max_request = 3;
+static int conf_session_timeout;
+static int conf_idle_timeout;
static const char *conf_relay;
@@ -1784,6 +1786,9 @@ struct ipoe_session *ipoe_session_alloc(void)
ses->ses.ctrl = &ses->ctrl;
+ ses->ses.idle_timeout = conf_idle_timeout;
+ ses->ses.session_timeout = conf_session_timeout;
+
return ses;
}
@@ -3174,6 +3179,18 @@ static void load_config(void)
else
conf_ip_unnumbered = 1;
+ opt = conf_get_opt("ipoe", "idle-timeout");
+ if (opt)
+ conf_idle_timeout = atoi(opt);
+ else
+ conf_idle_timeout = 0;
+
+ opt = conf_get_opt("ipoe", "session-timeout");
+ if (opt)
+ conf_session_timeout = atoi(opt);
+ else
+ conf_session_timeout = 0;
+
#ifdef RADIUS
if (triton_module_loaded("radius"))
load_radius_attrs();