mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-02-17 15:34:43 +02:00
[package] firewall: fix wrong rule order if multiple protocols are used
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25179 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
e88b36dfbb
commit
8abaf1c3f4
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
PKG_NAME:=firewall
|
PKG_NAME:=firewall
|
||||||
|
|
||||||
PKG_VERSION:=2
|
PKG_VERSION:=2
|
||||||
PKG_RELEASE:=20
|
PKG_RELEASE:=21
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
@ -52,11 +52,11 @@ fw_load_rule() {
|
|||||||
fw_get_negation src_spec '-s' "${rule_src_ip:+$rule_src_ip/$rule_src_ip_prefixlen}"
|
fw_get_negation src_spec '-s' "${rule_src_ip:+$rule_src_ip/$rule_src_ip_prefixlen}"
|
||||||
fw_get_negation dest_spec '-d' "${rule_dest_ip:+$rule_dest_ip/$rule_dest_ip_prefixlen}"
|
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#G}'_'$chain'))'
|
|
||||||
|
|
||||||
[ "$rule_proto" == "tcpudp" ] && rule_proto="tcp udp"
|
[ "$rule_proto" == "tcpudp" ] && rule_proto="tcp udp"
|
||||||
for rule_proto in $rule_proto; do
|
for rule_proto in $rule_proto; do
|
||||||
|
local rule_pos
|
||||||
|
eval 'rule_pos=$((++FW__RULE_COUNT_'${mode#G}'_'$chain'))'
|
||||||
|
|
||||||
fw add $mode $table $chain $target $rule_pos { $rule_src_ip $rule_dest_ip } { \
|
fw add $mode $table $chain $target $rule_pos { $rule_src_ip $rule_dest_ip } { \
|
||||||
$src_spec $dest_spec \
|
$src_spec $dest_spec \
|
||||||
${rule_proto:+-p $rule_proto} \
|
${rule_proto:+-p $rule_proto} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user