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

config/firewall/rules.pl

index fa7edee1bec2fb36645c144dc1bc77fd054ed937..5358996114979de58e464e7d958a78b320a4b68e 100644 (file)
@@ -586,6 +586,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;
        }
@@ -599,7 +602,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