Unify portrange-support in firewall rule generator
authorcyrus <cyrus@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 1 Jan 2009 13:05:16 +0000 (13:05 +0000)
committercyrus <cyrus@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 1 Jan 2009 13:05:16 +0000 (13:05 +0000)
fixes #4404

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13791 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/firewall/files/uci_firewall.sh

index 41b2b5f..93259fc 100755 (executable)
@@ -217,6 +217,16 @@ fw_rule() {
        config_get proto $1 proto
        config_get target $1 target
        config_get ruleset $1 ruleset
+
+       src_port_first=${src_port%-*}
+       src_port_last=${src_port#*-}
+       [ "$src_port_first" -ne "$src_port_last" ] && { \
+               src_port="$src_port_first:$src_port_last"; }
+
+       dest_port_first=${dest_port%-*}
+       dest_port_last=${dest_port#*-}
+       [ "$dest_port_first" -ne "$dest_port_last" ] && { \
+               dest_port="$dest_port_first:$dest_port_last"; }
        
        ZONE=input
        TARGET=$target
This page took 0.023261 seconds and 4 git commands to generate.