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/pppoe/pppoe.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'accel-pppd/ctrl/pppoe') 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; -- cgit v1.2.3