]> git.ipfire.org Git - people/stevee/guardian.git/commitdiff
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 ec253c05d33526db1b9b13302f6dfcccde87b574..30fdd968ee5acacd3fe5ab4f40e0423d89b5d6a2 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;
 }