commit 4a58af8d572aaede8782c2eb0599bd020eca9c42
parent 73047abe7b97dd57838fc14c837c5803212e3907
Author: Naveen Narayanan <zerous@nocebo.space>
Date: Sun, 10 Oct 2021 00:39:23 +0200
Check what list the attacker belongs to first
Ensure that only attackers who belong to grey
list get blacklisted.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
@@ -26,9 +26,11 @@ void
ban(struct attacker *a)
{
a->nban++;
- if (a->nban > 8)
+ if (a->list != GREY)
+ return;
+ if (fw_block(a->ip)
+ && a->nban > 8)
blacklist(a);
- fw_block(a->ip);
}
void