aboutsummaryrefslogtreecommitdiffstats
path: root/package/firewall
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-09-28 11:38:31 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-09-28 11:38:31 +0000
commit1a0d7a36124463a510a8e66689e9738d3ef6266d (patch)
tree46658a8e4cc5e7e8bd44ec270a30d719dfcd0459 /package/firewall
parenta1a31f183184bd6a0363d5d78319aafb92f55ba8 (diff)
downloadupstream-1a0d7a36124463a510a8e66689e9738d3ef6266d.tar.gz
upstream-1a0d7a36124463a510a8e66689e9738d3ef6266d.tar.bz2
upstream-1a0d7a36124463a510a8e66689e9738d3ef6266d.zip
firewall: fix chain selection logic, option dest must be ignored for notrack targets
SVN-Revision: 23143
Diffstat (limited to 'package/firewall')
-rw-r--r--package/firewall/files/lib/core_rule.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/package/firewall/files/lib/core_rule.sh b/package/firewall/files/lib/core_rule.sh
index dbaf1102e9..a0de3ba8bb 100644
--- a/package/firewall/files/lib/core_rule.sh
+++ b/package/firewall/files/lib/core_rule.sh
@@ -36,16 +36,15 @@ fw_load_rule() {
local table=f
local chain=input
- if [ "$rule_target" == "NOTRACK" ]; then
+ local target="${rule_target:-REJECT}"
+ if [ "$target" == "NOTRACK" ]; then
table=r
chain="zone_${rule_src}_notrack"
- elif [ -n "$rule_src" ]; then
- chain="zone_${rule_src}${rule_dest:+_forward}"
+ else
+ [ -n "$rule_src" ] && chain="zone_${rule_src}${rule_dest:+_forward}"
+ [ -n "$rule_dest" ] && target="zone_${rule_dest}_${target}"
fi
- local target="${rule_target:-REJECT}"
- [ -n "$dest" ] && target="zone_${rule_dest}_${target}"
-
local mode
fw_get_family_mode mode ${rule_family:-x} $rule_src I