diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-01-18 18:29:52 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-01-18 18:29:52 +0400 |
commit | b463f4f2559a6f0180ba09fb1cb43d51144e95f0 (patch) | |
tree | 10a01cbfeb1893219d4f98a8f33fb14e9421892a /accel-pppd/ctrl/pptp | |
parent | 010a21c48d1a9cc560e7d46e02acab80c79eae10 (diff) | |
download | accel-ppp-b463f4f2559a6f0180ba09fb1cb43d51144e95f0.tar.gz accel-ppp-b463f4f2559a6f0180ba09fb1cb43d51144e95f0.zip |
implemented connlimit module which can be used to reduce system overload due to flood of connections
Diffstat (limited to 'accel-pppd/ctrl/pptp')
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index b9930f3..b785b1f 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -23,6 +23,8 @@ #include "utils.h" #include "cli.h" +#include "connlimit.h" + #include "memdebug.h" #define STATE_IDLE 0 @@ -629,6 +631,11 @@ static int pptp_connect(struct triton_md_handler_t *h) continue; } + if (triton_module_loaded("connlimit") && connlimit_check(cl_key_from_ipv4(addr.sin_addr.s_addr))) { + close(sock); + return 0; + } + log_info2("pptp: new connection from %s\n", inet_ntoa(addr.sin_addr)); if (iprange_client_check(addr.sin_addr.s_addr)) { |