Make range-counting code a little less obscure

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5986 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-04-17 22:40:48 +00:00
parent ddc6b76e93
commit 3a4f05823f
2 changed files with 11 additions and 11 deletions

View File

@ -650,11 +650,11 @@ sub do_proto( $$$ )
if ( $count > 1 ) {
fatal_error "Port list requires Multiport support in your kernel/iptables: $ports" unless $capabilities{MULTIPORT};
for my $port ( @ports ) {
if ( $port =~ /:/ ) {
fatal_error "Port range in a list requires Extended Multiport Support in your kernel/iptables: $ports" unless $capabilities{XMULTIPORT};
$count++;
}
my @ranges = grep /:/, @ports;
if ( @ranges ) {
fatal_error "Port range in a list requires Extended Multiport Support in your kernel/iptables: $ports" unless $capabilities{XMULTIPORT};
$count += @ranges;
}
fatal_error "Too many entries in port list: $ports" if $count > 15;
@ -671,11 +671,11 @@ sub do_proto( $$$ )
if ( $count > 1 ) {
fatal_error "Port list requires Multiport support in your kernel/iptables: $sports" unless $capabilities{MULTIPORT};
for my $port ( @ports ) {
if ( $port =~ /:/ ) {
fatal_error "Port range in a list requires Extended Multiport Support in your kernel/iptables: $sports" unless $capabilities{XMULTIPORT};
$count++;
}
my @ranges = grep /:/, @ports;
if ( @ranges ) {
fatal_error "Port range in a list requires Extended Multiport Support in your kernel/iptables: $ports" unless $capabilities{XMULTIPORT};
$count += @ranges;
}
fatal_error "Too many entries in port list: $sports" if $count > 15;

View File

@ -31,7 +31,7 @@ use File::Basename;
our @ISA = qw(Exporter);
our @EXPORT = qw(
warning_message
fatal_error
fatal_error
find_file
split_line
open_file