aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-01-01 13:05:16 +0000
committerSteven Barth <steven@midlink.org>2009-01-01 13:05:16 +0000
commit79d4a6ac4a9104796e29a63099083bd4204afa64 (patch)
treeaa0c8d3f87d120f510d22cbcce56657fc43119af /package
parent5b30934a6fbbcdf3d1d22afeb521c95328cf4193 (diff)
downloadupstream-79d4a6ac4a9104796e29a63099083bd4204afa64.tar.gz
upstream-79d4a6ac4a9104796e29a63099083bd4204afa64.tar.bz2
upstream-79d4a6ac4a9104796e29a63099083bd4204afa64.zip
Unify portrange-support in firewall rule generator
fixes #4404 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13791 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-xpackage/firewall/files/uci_firewall.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/package/firewall/files/uci_firewall.sh b/package/firewall/files/uci_firewall.sh
index 41b2b5f76c..93259fc962 100755
--- a/package/firewall/files/uci_firewall.sh
+++ b/package/firewall/files/uci_firewall.sh
@@ -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