]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
rules.pl: Flush GEOIPBLOCK chain when the feature will be switched off. next-guardian-geoip
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 8 Mar 2015 09:09:16 +0000 (10:09 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 8 Mar 2015 09:09:16 +0000 (10:09 +0100)
Otherwise existing rules still remain in the chain and will be processed
even geoipblock has been disabled.

config/firewall/rules.pl

index a12ab56670f92342527cc4748349fc0301cbde2e..98ab22b4d858b8ef54f3fcbc700680e97ce396db 100644 (file)
@@ -589,6 +589,9 @@ sub geoipblock {
                # Read settings file
                &General::readhash("$geoipfile", \%geoipsettings);
        } else {
+               # Drop active rules.
+               run("$IPTABLES -F GEOIPBLOCK");
+
                # Exit submodule, go on processing the remaining script
                return;
        }
@@ -602,7 +605,7 @@ sub geoipblock {
        # Get supported locations.
        my @locations = &fwlib::get_geoip_locations();
 
-       # Create iptables chain.
+       # Flush iptables chain.
        run("$IPTABLES -F GEOIPBLOCK");
 
        # Loop through all supported geoip locations and