Browse Source

* call 'check' backend action before actual ban

master
Alex 'AdUser' Z 9 years ago
parent
commit
9acd858394
  1. 5
      src/jail.c

5
src/jail.c

@ -96,6 +96,11 @@ f2b_jail_ban(f2b_jail_t *jail, f2b_ipaddr_t *addr) {
addr->banned = true; addr->banned = true;
addr->bantime = addr->lastseen; addr->bantime = addr->lastseen;
if (f2b_backend_check(jail->backend, addr->text)) {
f2b_log_msg(log_warn, "jail '%s': ip '%s' already banned", jail->name, addr->text);
return true;
}
if (f2b_backend_ban(jail->backend, addr->text)) { if (f2b_backend_ban(jail->backend, addr->text)) {
f2b_log_msg(log_info, "jail '%s': banned ip %s", jail->name, addr->text); f2b_log_msg(log_info, "jail '%s': banned ip %s", jail->name, addr->text);
return true; return true;

Loading…
Cancel
Save