From 823ed26e30e95a034d8cbb6df7c726ddf62a438d Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 16 Dec 2008 00:02:17 +0000 Subject: [PATCH] Allow wide ipranges in IPv6 git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9068 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/IPAddrs.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Shorewall-perl/Shorewall/IPAddrs.pm b/Shorewall-perl/Shorewall/IPAddrs.pm index c2a4b8e40..f13018e58 100644 --- a/Shorewall-perl/Shorewall/IPAddrs.pm +++ b/Shorewall-perl/Shorewall/IPAddrs.pm @@ -555,10 +555,13 @@ sub validate_6range( $$ ) { my @low = split ":", $low; my @high = split ":", $high; + if ( @low == @high ) { - my ( $l, $h) = ( pop @low, pop @high ); - - return 1 if hex "0x$l" <= hex "0x$h" && join( ":", @low ) eq join( ":", @high ); + while ( @low ) { + my ( $l, $h) = ( shift @low, shift @high ); + next if $l eq $h; + return 1 if hex "0x$l" < hex "0x$h"; + } } fatal_error "Invalid IPv6 Range ($low-$high)";