summaryrefslogtreecommitdiffstats
path: root/package/firewall/files/lib/fw.sh
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-05-19 01:55:46 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-05-19 01:55:46 +0000
commit3ffd27f90558a7df28b983b7b635b62e0480f509 (patch)
tree7ca748db93d1c3edbfe98483437930668b6a87a1 /package/firewall/files/lib/fw.sh
parentc6fdffd9324698cf6147fc3c7dce1cb0526c4d16 (diff)
downloadmaster-31e0f0ae-3ffd27f90558a7df28b983b7b635b62e0480f509.tar.gz
master-31e0f0ae-3ffd27f90558a7df28b983b7b635b62e0480f509.tar.bz2
master-31e0f0ae-3ffd27f90558a7df28b983b7b635b62e0480f509.zip
firewall: implement disable_ipv6 uci option
SVN-Revision: 21503
Diffstat (limited to 'package/firewall/files/lib/fw.sh')
-rw-r--r--package/firewall/files/lib/fw.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/package/firewall/files/lib/fw.sh b/package/firewall/files/lib/fw.sh
index 72aa37c5bf..1dd5227c16 100644
--- a/package/firewall/files/lib/fw.sh
+++ b/package/firewall/files/lib/fw.sh
@@ -72,7 +72,7 @@ fw__exec() { # <action> <family> <table> <chain> <target> <position> { <rules> }
if [ $tab == '-' ]; then
type $app > /dev/null 2> /dev/null
fw__rc $(($? & 1))
- return
+ return
fi
local mod
eval "mod=\$FW_${fam}_${tab}"
@@ -85,7 +85,7 @@ fw__exec() { # <action> <family> <table> <chain> <target> <position> { <rules> }
6) mod=ip6table_${tab} ;;
*) mod=. ;;
esac
- grep "^${mod} " /proc/modules > /dev/null
+ grep -q "^${mod} " /proc/modules
mod=$?
export FW_${fam}_${tab}=$mod
fw__rc $mod
@@ -100,8 +100,8 @@ fw__exec() { # <action> <family> <table> <chain> <target> <position> { <rules> }
local app=
local pol=
case "$fam" in
- 4) app=iptables ;;
- 6) app=ip6tables ;;
+ 4) [ $FW_DISABLE_IPV4 == 0 ] && app=iptables || return ;;
+ 6) [ $FW_DISABLE_IPV6 == 0 ] && app=ip6tables || return ;;
i) fw__dualip "$@"; return ;;
I) fw__autoip "$@"; return ;;
e) app=ebtables ;;