X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/92af8399eb58939daa0b6133527a6fe9a218cfcf..4ccd13ebfa22d9ae1dee2091ee780147088d6eec:/package/firewall/files/uci_firewall.sh diff --git a/package/firewall/files/uci_firewall.sh b/package/firewall/files/uci_firewall.sh index 4921b91ba..8d7538201 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} \