[1/2] firewall: Silence warnings if blocklist logging is not set.

Message ID 20230307121735.6485-1-stefan.schantl@ipfire.org
State Accepted
Commit 1b70ead36dfaf6541677e4ac5d05867273eaa265
Headers
Series [1/2] firewall: Silence warnings if blocklist logging is not set. |

Commit Message

Stefan Schantl March 7, 2023, 12:17 p.m. UTC
  Reference: #12979.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/firewall/rules.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl
index 1b628df16..80985ca53 100644
--- a/config/firewall/rules.pl
+++ b/config/firewall/rules.pl
@@ -761,7 +761,7 @@  sub ipblocklist () {
 			}
 
 			# Check if logging is enabled.
-			if($blocklistsettings{'LOGGING'} eq "on") {
+			if($blocklistsettings{'LOGGING'}) && ($blocklistsettings{'LOGGING'} eq "on")) {
 				# Create logging rule.
 				run("$IPTABLES -A ${blocklist}_DROP -j LOG -m limit --limit 10/second --log-prefix \"BLKLST_$blocklist \"");
 			}