firewall: insert SNAT and DNAT rules according to the order of the configuration...
[openwrt/staging/yousong.git] / package / firewall / files / lib / core_rule.sh
index a0de3ba8bb5da4ef7919bdf540cacc5fd9ede86e..9443eef8cfe654bb53ad6cf58dea9309501154aa 100644 (file)
@@ -53,7 +53,7 @@ fw_load_rule() {
        fw_get_negation dest_spec '-d' "${rule_dest_ip:+$rule_dest_ip/$rule_dest_ip_prefixlen}"
 
        local rule_pos
-       eval 'rule_pos=$((++FW__RULE_COUNT_'$mode'_'$chain'))'
+       eval 'rule_pos=$((++FW__RULE_COUNT_'${mode#G}'_'$chain'))'
 
        [ "$rule_proto" == "tcpudp" ] && rule_proto="tcp udp"
        for rule_proto in $rule_proto; do