diff options
author | John Crispin <blogic@openwrt.org> | 2008-09-28 17:40:09 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2008-09-28 17:40:09 +0000 |
commit | 3f4018d1b5cdd8f349f1f5169f6a924361c5696d (patch) | |
tree | dbf84078c08f5d63dff7bd9a5ecbdab8a2d1f58a /package/firewall/files | |
parent | 1e14eeaa9ffb75f7a4663e4a0ff45d0a41003b53 (diff) | |
download | master-187ad058-3f4018d1b5cdd8f349f1f5169f6a924361c5696d.tar.gz master-187ad058-3f4018d1b5cdd8f349f1f5169f6a924361c5696d.tar.bz2 master-187ad058-3f4018d1b5cdd8f349f1f5169f6a924361c5696d.zip |
fixes firewall rule generation. forwarding rules were inserted in input chains, fixes #4028
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12768 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/firewall/files')
-rwxr-xr-x | package/firewall/files/uci_firewall.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/package/firewall/files/uci_firewall.sh b/package/firewall/files/uci_firewall.sh index 5798b7fc48..0f7e2ff058 100755 --- a/package/firewall/files/uci_firewall.sh +++ b/package/firewall/files/uci_firewall.sh @@ -216,10 +216,13 @@ fw_rule() { config_get proto $1 proto config_get target $1 target config_get ruleset $1 ruleset - + + ZONE=input + TARGET=$target [ -z "$target" ] && target=DROP - [ -n "$src" ] && ZONE=zone_$src || ZONE=input - [ -n "$dest" ] && TARGET=zone_${dest}_$target || TARGET=$target + [ -n "$src" -a -z "$dest" ] && ZONE=zone_$src + [ -n "$src" -a -n "$dest" ] && ZONE=zone_${src}_forward + [ -n "$dest" ] && TARGET=zone_${dest}_$target add_rule() { $IPTABLES -I $ZONE 1 \ ${proto:+-p $proto} \ |