]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/firewall/rules.pl
firewall: Suppress warning about uninitialized array in GeoIP code
[ipfire-2.x.git] / config / firewall / rules.pl
index 8b0c6ddc8e69ac06339c39e3a1aec11ca47f445f..9817634c84cf54f9e2c7baff33af0760e24051f9 100644 (file)
@@ -608,7 +608,7 @@ sub geoipblock {
        # create iptables rules, if blocking this country
        # is enabled.
        foreach my $location (@locations) {
-               if($geoipsettings{$location} eq "on") {
+               if(exists $geoipsettings{$location} && $geoipsettings{$location} eq "on") {
                        run("$IPTABLES -A GEOIPBLOCK -m geoip --src-cc $location -j DROP");
                }
        }