From 71611233fb58664affcfff2d5384040ea565a755 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 26 Aug 2015 11:51:29 -0700 Subject: [PATCH] Correct IPV6 range parsing Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/IPAddrs.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Shorewall/Perl/Shorewall/IPAddrs.pm b/Shorewall/Perl/Shorewall/IPAddrs.pm index edf18e236..d6d9c0ab2 100644 --- a/Shorewall/Perl/Shorewall/IPAddrs.pm +++ b/Shorewall/Perl/Shorewall/IPAddrs.pm @@ -779,6 +779,18 @@ sub normalize_6addr( $ ) { sub validate_6range( $$ ) { 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 $high, 0;