summaryrefslogtreecommitdiff
path: root/package/firewall/files/uci_firewall.sh
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2009-01-01 13:05:16 +0000
committerSteven Barth <cyrus@openwrt.org>2009-01-01 13:05:16 +0000
commitd1049f535a8bfde74aea6c417b873cf58516d222 (patch)
treede49335c5b4e16723820ade66f6ff4192a5bb0ca /package/firewall/files/uci_firewall.sh
parent35078a6a52a6308422c8c745b2ef148380ef3471 (diff)
downloadmtk-20170518-d1049f535a8bfde74aea6c417b873cf58516d222.zip
mtk-20170518-d1049f535a8bfde74aea6c417b873cf58516d222.tar.gz
mtk-20170518-d1049f535a8bfde74aea6c417b873cf58516d222.tar.bz2
Unify portrange-support in firewall rule generator fixes #4404
SVN-Revision: 13791
Diffstat (limited to 'package/firewall/files/uci_firewall.sh')
-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 41b2b5f..93259fc 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