From d73763277deb841b78cc8c07e35c295813b60e3f Mon Sep 17 00:00:00 2001 From: bbruns Date: Wed, 25 Aug 2010 17:26:04 +0000 Subject: [PATCH] Some more minor changes --- include/functions | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/functions b/include/functions index fbfda40..62598c8 100644 --- a/include/functions +++ b/include/functions @@ -80,19 +80,21 @@ function reset_color { function iptables_rules_flush { IP_VERSION=$1 case $IP_VERSION in - ipv6) VER_IPTABLES=$IP6TABLES ;; - ipv4|*) VER_IPTABLES=$IPTABLES ;; + ipv6) VER_IPTABLES=$IP6TABLES ; TABLE_NAMES=/proc/net/ip6_tables_names ;; + ipv4|*) VER_IPTABLES=$IPTABLES ; TABLE_NAMES=/proc/net/ip_tables_names ;; esac display_c RED "Flushing ${IP_VERSION} rules..." $VER_IPTABLES --flush &>/dev/null $VER_IPTABLES -F OUTPUT &>/dev/null $VER_IPTABLES -F PREROUTING &>/dev/null $VER_IPTABLES -F POSTROUTING &>/dev/null - $VER_IPTABLES -F -t mangle &>/dev/null - if [ $NAT ] && [ $IP_VERSION == "ipv4" ]; then - $VER_IPTABLES -F -t nat &>/dev/null - fi - $VER_IPTABLES -F -t raw &>/dev/null + for i in `cat $TABLE_NAMES`; do + $VER_IPTABLES -F -t $i &>/dev/null + done + #if [ $NAT ] && [ $IP_VERSION == "ipv4" ]; then + # $VER_IPTABLES -F -t nat &>/dev/null + #fi + #$VER_IPTABLES -F -t raw &>/dev/null } # iptables_policy_set (ipv6|ipv4) (ACCEPT|DROP)