forked from extern/shorewall_code
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:
parent
d650bc1df9
commit
4d2afe84f1
@ -645,10 +645,12 @@ sub do_proto( $$$ )
|
|||||||
|
|
||||||
if ( $count > 1 ) {
|
if ( $count > 1 ) {
|
||||||
fatal_error "Port list requires Multiport support in your kernel/iptables: $ports" unless $capabilities{MULTIPORT};
|
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 ) {
|
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;
|
fatal_error "Too many entries in port list: $ports" if $count > 15;
|
||||||
@ -665,10 +667,12 @@ sub do_proto( $$$ )
|
|||||||
|
|
||||||
if ( $count > 1 ) {
|
if ( $count > 1 ) {
|
||||||
fatal_error "Port list requires Multiport support in your kernel/iptables: $sports" unless $capabilities{MULTIPORT};
|
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 ) {
|
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;
|
fatal_error "Too many entries in port list: $sports" if $count > 15;
|
||||||
|
Loading…
Reference in New Issue
Block a user