firewall: fix udp rules for tcpudp proto rules using src_port and dest_port after...
authorDaniel Dickinson <crazycshore@gmail.com>
Wed, 6 Jul 2011 06:26:12 +0000 (06:26 +0000)
committerDaniel Dickinson <crazycshore@gmail.com>
Wed, 6 Jul 2011 06:26:12 +0000 (06:26 +0000)
SVN-Revision: 27469

package/firewall/files/lib/core_rule.sh

index 64a510df924698940de2d433af362e992ae487ae..55381598b576883a11c978e42d3e935da5d6c98b 100644 (file)
@@ -65,8 +65,15 @@ fw_load_rule() {
        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}"
 
+       local rule_src_port_copy
+       local rule_dest_port_copy
+
        [ "$rule_proto" == "tcpudp" ] && rule_proto="tcp udp"
+       rule_src_port_copy="$rule_src_port"
+       rule_dest_port_copy="$rule_dest_port"
        for rule_proto in $rule_proto; do
+               rule_src_port="$rule_src_port_copy"
+               rule_dest_port="$rule_dest_port_copy"
                fw_get_negation rule_proto '-p' "$rule_proto"
                for rule_src_port in ${rule_src_port:-""}; do
                        fw_get_port_range rule_src_port $rule_src_port