Correct IPV6 range parsing

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2015-08-26 11:51:29 -07:00
parent 7a98c7b9e5
commit 71611233fb

View File

@ -779,6 +779,18 @@ sub normalize_6addr( $ ) {
sub validate_6range( $$ ) { sub validate_6range( $$ ) {
my ( $low, $high ) = @_; my ( $low, $high ) = @_;
if ( $low =~ /^\[(.+)\]$/ ) {
$low = $1;
} elsif ( $low =~ /^\[(.+)\]\/(\d+)$/ ) {
$low = join( '/', $1, $2 );
}
if ( $high =~ /^\[(.+)\]$/ ) {
$high = $1;
} elsif ( $high =~ /^\[(.+)\]\/(\d+)$/ ) {
$high = join( '/', $1, $2 );
}
validate_6address $low, 0; validate_6address $low, 0;
validate_6address $high, 0; validate_6address $high, 0;