diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-02 11:02:24 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-02 11:02:24 +0000 |
commit | ef66d316b26f84d99c954ab9c2d8b39e408044a0 (patch) | |
tree | ade1889db6641b661733da55bfdc90095fffd6e0 /package/firewall/files/uci_firewall.sh | |
parent | 7f49838c10fa9fe9a82facfe8b0d479df48dd718 (diff) | |
download | master-187ad058-ef66d316b26f84d99c954ab9c2d8b39e408044a0.tar.gz master-187ad058-ef66d316b26f84d99c954ab9c2d8b39e408044a0.tar.bz2 master-187ad058-ef66d316b26f84d99c954ab9c2d8b39e408044a0.zip |
[package] firewall: insert rules at the beginning of chains again while maintaining non reversed order, fixes wrong ordering introduced by r18015
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19946 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/firewall/files/uci_firewall.sh')
-rwxr-xr-x | package/firewall/files/uci_firewall.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/package/firewall/files/uci_firewall.sh b/package/firewall/files/uci_firewall.sh index 4921b91bae..8d7538201b 100755 --- a/package/firewall/files/uci_firewall.sh +++ b/package/firewall/files/uci_firewall.sh @@ -294,8 +294,11 @@ fw_rule() { [ -n "$src" -a -z "$dest" ] && ZONE=zone_$src [ -n "$src" -a -n "$dest" ] && ZONE=zone_${src}_forward [ -n "$dest" ] && TARGET=zone_${dest}_$target + + eval 'RULE_COUNT=$((++RULE_COUNT_'$ZONE'))' + add_rule() { - $IPTABLES -A $ZONE \ + $IPTABLES -I $ZONE $RULE_COUNT \ ${proto:+-p $proto} \ ${icmp_type:+--icmp-type $icmp_type} \ ${src_ip:+-s $src_ip} \ |