From 6b04e5778c1c0c9686066dd44caccfd755917c25 Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Sat, 7 Mar 2020 04:25:00 +0500 Subject: 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. --- accel-pppd/ctrl/ipoe/ipoe.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'accel-pppd/ctrl/ipoe') 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; -- cgit v1.2.3