diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-06-27 22:49:37 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2018-06-27 22:49:37 +0200 |
commit | 4394574e4b996322b802dff0cfe43bb980214cba (patch) | |
tree | 24d3075e46228373363c85ba41ce53edc66bbee7 /src/redirector.c | |
parent | c37398b36468f05d45049ac4f14a3e3f40f2076f (diff) |
protocol ssh login cache [+] login probability
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/redirector.c')
-rw-r--r-- | src/redirector.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/redirector.c b/src/redirector.c index de7e922..01f1eaf 100644 --- a/src/redirector.c +++ b/src/redirector.c @@ -272,6 +272,7 @@ static int redirector_accept_client(event_ctx *ev_ctx, int fd, void *user_data) goto error; } + /* DDoS protection */ ev_srv->last_accept_count++; t = time(NULL); d = difftime(t, ev_srv->last_accept_stamp); @@ -282,7 +283,7 @@ static int redirector_accept_client(event_ctx *ev_ctx, int fd, void *user_data) ev_srv->last_accept_count = 0; } if (ev_srv->last_accept_count / (size_t)d > 3) { - W2("DoS protection: Got %zu accepts/s", + W2("DDoS protection: Got %zu accepts/s", ev_srv->last_accept_count / (size_t)d); goto error; } |