summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/ipoe
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/ipoe
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/ipoe')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 17e437d..87261cb 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -1302,6 +1302,9 @@ static struct ipoe_session *ipoe_session_create_dhcpv4(struct ipoe_serv *serv, s
if (ap_shutdown)
return NULL;
+ if (conf_max_starting && ap_session_stat.starting >= conf_max_starting)
+ return NULL;
+
if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting >= conf_max_sessions)
return NULL;
@@ -2025,12 +2028,15 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc
if (ap_shutdown)
return NULL;
- if (connlimit_loaded && connlimit_check(cl_key_from_ipv4(saddr)))
+ if (conf_max_starting && ap_session_stat.starting >= conf_max_starting)
return NULL;
if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting >= conf_max_sessions)
return NULL;
+ if (connlimit_loaded && connlimit_check(cl_key_from_ipv4(saddr)))
+ return NULL;
+
if (l4_redirect_list_check(saddr))
return NULL;