Fix port range validation

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5604 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-21 00:55:01 +00:00
parent d650bc1df9
commit 4d2afe84f1

View File

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