]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
rules.pl: Move flush of LOCATIONBLOCK into main flush() function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 11 Feb 2022 20:23:45 +0000 (21:23 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 11 Feb 2022 20:23:45 +0000 (21:23 +0100)
It is required to get rid of all ipset based rules before all of
the loaded ipset lists can be destroyed.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/firewall/rules.pl

index 9d280045adf6dcbaa72df3d45b4f09e22107825b..f685d08a7f3caf8ea9606207b00c7fc52da79e2d 100644 (file)
@@ -186,6 +186,9 @@ sub flush {
        run("$IPTABLES -t nat -F $CHAIN_NAT_SOURCE");
        run("$IPTABLES -t nat -F $CHAIN_NAT_DESTINATION");
        run("$IPTABLES -t mangle -F $CHAIN_MANGLE_NAT_DESTINATION_FIX");
+
+       # Flush LOCATIONBLOCK chain.
+       run("$IPTABLES -F LOCATIONBLOCK");
 }
 
 sub buildrules {
@@ -638,8 +641,7 @@ sub p2pblock {
 }
 
 sub locationblock {
-       # Flush iptables chain.
-       run("$IPTABLES -F LOCATIONBLOCK");
+       # The LOCATIONBLOCK chain now gets flushed by the flush() function.
 
        # If location blocking is not enabled, we are finished here.
        if ($locationsettings{'LOCATIONBLOCK_ENABLED'} ne "on") {