summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pppoe
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2020-03-07 04:25:00 +0500
committerVladislav Grishenko <themiron@mail.ru>2020-03-07 04:31:11 +0500
commit6b04e5778c1c0c9686066dd44caccfd755917c25 (patch)
treeb6cceaeba9dcdfe649976210329ae3e698b60e58 /accel-pppd/ctrl/pppoe
parenta76cfa750c2176b3156dcc65968aff8c90496de0 (diff)
downloadaccel-ppp-6b04e5778c1c0c9686066dd44caccfd755917c25.tar.gz
accel-ppp-6b04e5778c1c0c9686066dd44caccfd755917c25.zip
session: add global [common]max-starting option
usually there's no need to have per-proto limitation, since the need of max starting limitation affects the whole server, not particular protocol only.
Diffstat (limited to 'accel-pppd/ctrl/pppoe')
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 120e161..718ebc5 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -966,6 +966,9 @@ static void pppoe_recv_PADI(struct pppoe_serv_t *serv, uint8_t *pack, int size)
if (ap_shutdown || pado_delay == -1)
return;
+ if (conf_max_starting && ap_session_stat.starting >= conf_max_starting)
+ return;
+
if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting >= conf_max_sessions)
return;
@@ -1093,6 +1096,9 @@ static void pppoe_recv_PADR(struct pppoe_serv_t *serv, uint8_t *pack, int size)
if (ap_shutdown)
return;
+ if (conf_max_starting && ap_session_stat.starting >= conf_max_starting)
+ return;
+
if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting >= conf_max_sessions)
return;