From 43750a70c9a22faa7d11f5861b53604d33b26564 Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 17 Apr 2007 23:14:42 +0000 Subject: [PATCH] Enough of this git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5988 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Chains.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index ff20c5d79..927c3cfdf 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -644,9 +644,9 @@ sub do_proto( $$$ ) if ( $proto ) { if ( $proto =~ /^(tcp|udp|6|17)$/i ) { $output = "-p $proto "; - my @ports = split /,/, $ports; - if ( @ports ) { - if ( @ports > 1 ) { + + if ( $ports ) { + if ( $ports =~ tr/,/,/ > 1 ) { fatal_error "Port list requires Multiport support in your kernel/iptables: $ports" unless $capabilities{MULTIPORT}; fatal_error "Too many entries in port list: $ports" if $ports =~ tr/,:/,:/ > 14; @@ -657,9 +657,8 @@ sub do_proto( $$$ ) } } - @ports = split /,/, $sports; - if ( @ports ) { - if ( @ports > 1 ) { + if ( $sports ) { + if ( $sports =~ tr/,/,/ > 1 ) { fatal_error "Port list requires Multiport support in your kernel/iptables: $sports" unless $capabilities{MULTIPORT}; fatal_error "Too many entries in port list: $sports" if $sports =~ tr/,:/,:/ > 14;