summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2017-04-18 21:21:37 +0300
committerDmitry Kozlov <xeb@mail.ru>2017-04-18 21:21:37 +0300
commitbf4fabd6c50a34d4223bdc78be9e852720f71bba (patch)
tree7ebb75e44f5d1a338aa1fe1a0171d5c7ddc9e61c /accel-pppd/ctrl
parent88a908974b0b2e9c7eee8ad9a8b0b4432e95d167 (diff)
downloadaccel-ppp-bf4fabd6c50a34d4223bdc78be9e852720f71bba.tar.gz
accel-ppp-bf4fabd6c50a34d4223bdc78be9e852720f71bba.zip
Revert "implemented session count limiting"
This reverts commit 88a908974b0b2e9c7eee8ad9a8b0b4432e95d167.
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c9
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c9
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c6
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c7
4 files changed, 1 insertions, 30 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 46b6defb..b8aba6c9 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -1241,12 +1241,6 @@ static struct ipoe_session *ipoe_session_create_dhcpv4(struct ipoe_serv *serv, s
int dlen = 0;
uint8_t *ptr = NULL;
- if (ap_shutdown)
- return NULL;
-
- if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions)
- return NULL;
-
ses = ipoe_session_alloc(serv->ifname);
if (!ses)
return NULL;
@@ -1890,9 +1884,6 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc
if (ap_shutdown)
return NULL;
- if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions)
- return NULL;
-
if (l4_redirect_list_check(saddr))
return NULL;
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index 6399655e..bb3df4d4 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -2737,9 +2737,6 @@ static int l2tp_recv_SCCRQ(const struct l2tp_serv_t *serv,
return 0;
}
- if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions)
- return 0;
-
if (triton_module_loaded("connlimit")
&& connlimit_check(cl_key_from_ipv4(pack->addr.sin_addr.s_addr))) {
log_warn("l2tp: connection limits reached,"
@@ -3266,9 +3263,6 @@ static int l2tp_recv_ICRQ(struct l2tp_conn_t *conn,
return 0;
}
- if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions)
- return 0;
-
if (triton_module_loaded("connlimit")
&& connlimit_check(cl_key_from_ipv4(conn->peer_addr.sin_addr.s_addr))) {
log_tunnel(log_warn, conn, "connection limits reached,"
@@ -3569,9 +3563,6 @@ static int l2tp_recv_OCRQ(struct l2tp_conn_t *conn,
return 0;
}
- if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions)
- return 0;
-
if (triton_module_loaded("connlimit")
&& connlimit_check(cl_key_from_ipv4(conn->peer_addr.sin_addr.s_addr))) {
log_tunnel(log_warn, conn, "connection limits reached,"
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 520c4f1b..ff6b76f2 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -950,9 +950,6 @@ 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_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions)
- return;
-
if (check_padi_limit(serv, ethhdr->h_source)) {
__sync_add_and_fetch(&stat_PADI_drop, 1);
if (conf_verbose) {
@@ -1072,9 +1069,6 @@ static void pppoe_recv_PADR(struct pppoe_serv_t *serv, uint8_t *pack, int size)
if (ap_shutdown)
return;
- if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions)
- return;
-
if (!memcmp(ethhdr->h_dest, bc_addr, ETH_ALEN)) {
if (conf_verbose)
log_warn("pppoe: discard PADR (destination address is broadcast)\n");
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c
index c8731ca7..4aba5767 100644
--- a/accel-pppd/ctrl/pptp/pptp.c
+++ b/accel-pppd/ctrl/pptp/pptp.c
@@ -648,14 +648,9 @@ static int pptp_connect(struct triton_md_handler_t *h)
continue;
}
- if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting > conf_max_sessions) {
- close(sock);
- continue;
- }
-
if (triton_module_loaded("connlimit") && connlimit_check(cl_key_from_ipv4(addr.sin_addr.s_addr))) {
close(sock);
- continue;
+ return 0;
}
log_info2("pptp: new connection from %s\n", inet_ntoa(addr.sin_addr));