]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
rules.pl: fix geoip initialisation.
authorArne Fitzenreiter <arne_f@ipfire.org>
Mon, 20 Apr 2015 21:14:11 +0000 (23:14 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 20 Apr 2015 21:14:11 +0000 (23:14 +0200)
config/firewall/rules.pl

index 5358996114979de58e464e7d958a78b320a4b68e..daa95651bbecaf02d70bf143856dd6546f082c29 100644 (file)
@@ -580,17 +580,15 @@ sub p2pblock {
 
 sub geoipblock {
        my %geoipsettings = ();
+       $geoipsettings{'GEOIPBLOCK_ENABLED'} = "off";
+
+       # Flush iptables chain.
+       run("$IPTABLES -F GEOIPBLOCK");
 
        # Check if the geoip settings file exists
        if (-e "$geoipfile") {
                # Read settings file
                &General::readhash("$geoipfile", \%geoipsettings);
-       } else {
-               # Drop active rules.
-               run("$IPTABLES -F GEOIPBLOCK");
-
-               # Exit submodule, go on processing the remaining script
-               return;
        }
 
        # If geoip blocking is not enabled, we are finished here.
@@ -602,9 +600,6 @@ sub geoipblock {
        # Get supported locations.
        my @locations = &fwlib::get_geoip_locations();
 
-       # Flush iptables chain.
-       run("$IPTABLES -F GEOIPBLOCK");
-
        # Loop through all supported geoip locations and
        # create iptables rules, if blocking this country
        # is enabled.