forked from extern/shorewall_code
Correct IPv6 address checking (again)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
0461e5de20
commit
93b3fd9be5
@ -648,14 +648,18 @@ sub resolve_6dnsname( $ ) {
|
||||
sub validate_6net( $$ ) {
|
||||
my ( $net, $allow_name ) = @_;
|
||||
|
||||
if ( $net =~ /^\[(.*)]$/ ) {
|
||||
if ( $net =~ /^\[(.+)]$/ ) {
|
||||
$net = $1;
|
||||
} elsif ( $net =~ /^\[(.*)\]\/(\d+)$/ ) {
|
||||
} elsif ( $net =~ /^\[(.+)\]\/(\d+)$/ ) {
|
||||
$net = join( '/', $1, $2 );
|
||||
}
|
||||
|
||||
fatal_error "Invalid Network Address($net)" if $net =~ /\[/;
|
||||
|
||||
($net, my $vlsm, my $rest) = split( '/', $net, 3 );
|
||||
|
||||
fatal_error 'Invalid Network Address(' . join( '/', $net, $vlsm, $rest ) if defined $rest;
|
||||
|
||||
if ( $net =~ /\+(\[?)/ ) {
|
||||
if ( $1 ) {
|
||||
fatal_error "An ipset list ($net) is not allowed in this context";
|
||||
|
Loading…
Reference in New Issue
Block a user