Drop address from counthash when manually unblocking a host.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 19 Jul 2016 07:43:22 +0000 (09:43 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 19 Jul 2016 07:43:22 +0000 (09:43 +0200)
When a host address manualy get unblocked by calling the
unblock command via socket connection, the address now
will be dropped from counthash too.

If an address get unblocked because the configured BlockTime ends,
the entry still remains in the counthash and will be blocked again,
next time the address will be counted.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
modules/Events.pm

index ec253c0..30fdd96 100644 (file)
@@ -320,6 +320,12 @@ sub CallUnblock ($) {
        # Drop address from blockhash.
        delete ($blockhash{$address});
 
+       # Drop address from counthash if the address has been unblocked
+       # by the user. This happens when the called module is "Socket".
+       if ($module eq "Socket") {
+               delete ($counthash{$address});
+       }
+
        # Everything worked well, return nothing.
        return undef;
 }