]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/firewall/rules.pl
firewall: Silence warnings if blocklist logging is not set.
[ipfire-2.x.git] / config / firewall / rules.pl
index 30ad20df1d9a31ff86a08784364daf3c24e192dc..80985ca530ec68e8191334125f18649f7f5eb429 100644 (file)
@@ -401,6 +401,9 @@ sub buildrules {
                                        $source = "";
                                }
 
+                               # Make sure that $source is properly defined
+                               next unless (defined $source);
+
                                my $source_intf = @$src[1];
 
                                foreach my $dst (@destinations) {
@@ -758,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 \"");
                        }