summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2008-09-28 17:40:09 +0000
committerJohn Crispin <john@openwrt.org>2008-09-28 17:40:09 +0000
commit221f4ad32d94481baf53885553a4fb3feda22965 (patch)
tree55ca841ded7474892e1632f90a6ffd3f6c166e4e /package
parentb56d5cc36f33d8db37b8c541b895bf7532d541b4 (diff)
downloadmtk-20170518-221f4ad32d94481baf53885553a4fb3feda22965.zip
mtk-20170518-221f4ad32d94481baf53885553a4fb3feda22965.tar.gz
mtk-20170518-221f4ad32d94481baf53885553a4fb3feda22965.tar.bz2
fixes firewall rule generation. forwarding rules were inserted in input chains, fixes #4028
SVN-Revision: 12768
Diffstat (limited to 'package')
-rwxr-xr-xpackage/firewall/files/uci_firewall.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/package/firewall/files/uci_firewall.sh b/package/firewall/files/uci_firewall.sh
index 5798b7f..0f7e2ff 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} \