From: Stefan Schantl Date: Tue, 19 Jul 2016 07:43:22 +0000 (+0200) Subject: Drop address from counthash when manually unblocking a host. X-Git-Tag: 2.0~6 X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fguardian.git;a=commitdiff_plain;h=e2377f6327a5c85eae700262f91254ef30c76b31 Drop address from counthash when manually unblocking a host. 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 --- diff --git a/modules/Events.pm b/modules/Events.pm index ec253c0..30fdd96 100644 --- a/modules/Events.pm +++ b/modules/Events.pm @@ -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; }