From 23430d11185a3404b1009a940776e9071803adfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sun, 22 Mar 2020 12:11:05 +0100 Subject: [PATCH] ban log: only log once when adding, not when increasing score when already banned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Bühler --- src/main-ban.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main-ban.c b/src/main-ban.c index dcbb86fa..34615766 100644 --- a/src/main-ban.c +++ b/src/main-ban.c @@ -155,9 +155,9 @@ int add_ip_to_ban_list(main_server_st *s, const unsigned char *ip, unsigned ip_s * periodically polls the server */ if (e->score < GETCONFIG(s)->max_ban_score) { e->expires = expiration; - print_msg = 0; - } else print_msg = 1; + } else + print_msg = 0; /* prevent overflow */ e->score = (e->score + score) > e->score ? (e->score + score) : (e->score);