aboutsummaryrefslogtreecommitdiffstats
path: root/package/firewall
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-03-02 11:02:24 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-03-02 11:02:24 +0000
commitf96ecd026d6c8fdb48d1eaec71838193559850a0 (patch)
tree907ce2c0aa0d1d6d1c241ed530ce3dcd0052cdf6 /package/firewall
parentb3f90f939bff33fcfd980b16d9a5d63c20f55e5c (diff)
downloadupstream-f96ecd026d6c8fdb48d1eaec71838193559850a0.tar.gz
upstream-f96ecd026d6c8fdb48d1eaec71838193559850a0.tar.bz2
upstream-f96ecd026d6c8fdb48d1eaec71838193559850a0.zip
firewall: insert rules at the beginning of chains again while maintaining non reversed order, fixes wrong ordering introduced by r18015
SVN-Revision: 19946
Diffstat (limited to 'package/firewall')
-rwxr-xr-xpackage/firewall/files/uci_firewall.sh5
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} \