[package] firewall: fix chain selection logic, option dest must be ignored for notrac...
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 28 Sep 2010 11:38:31 +0000 (11:38 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 28 Sep 2010 11:38:31 +0000 (11:38 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23143 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/firewall/files/lib/core_rule.sh

index dbaf110..a0de3ba 100644 (file)
@@ -36,16 +36,15 @@ fw_load_rule() {
 
        local table=f
        local chain=input
 
        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"
                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
 
        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
 
        local mode
        fw_get_family_mode mode ${rule_family:-x} $rule_src I
 
This page took 0.028213 seconds and 4 git commands to generate.