From d1049f535a8bfde74aea6c417b873cf58516d222 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 1 Jan 2009 13:05:16 +0000 Subject: Unify portrange-support in firewall rule generator fixes #4404 SVN-Revision: 13791 --- package/firewall/files/uci_firewall.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'package/firewall') 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 -- cgit v1.2.3