Correct IPv6 List Handling

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-02-11 16:45:03 -08:00
parent db8f90f182
commit 1ede47034b

View File

@ -6328,8 +6328,13 @@ sub isolate_source_interface( $ ) {
} else {
$iiface = $source;
}
} elsif ( $source =~ /^(.+?):<(.+)>\s*$/ ||
$source =~ /^(.+?):\[(.+)\]\s*$/ ||
} else {
$source =~ tr/<>/[]/;
if ( $source =~ /^(.+?):(\[(?:.+)\],\[(?:.+)\])$/ ) {
$iiface = $1;
$inets = $2;
} elsif ( $source =~ /^(.+?):\[(.+)\]\s*$/ ||
$source =~ /^(.+?):(!?\+.+)$/ ||
$source =~ /^(.+?):(!?[&%].+)$/ ||
$source =~ /^(.+?):(\[.+\]\/(?:\d+))\s*$/
@ -6337,7 +6342,9 @@ sub isolate_source_interface( $ ) {
$iiface = $1;
$inets = $2;
} elsif ( $source =~ /:/ ) {
if ( $source =~ /^<(.+)>$/ || $source =~ /^\[(.+)\]$/ ) {
if ( $source =~ /^\[(?:.+)\],\[(?:.+)\]$/ ){
$inets = $source;
} elsif ( $source =~ /^\[(.+)\]$/ ) {
$inets = $1;
} else {
$inets = $source;
@ -6347,6 +6354,7 @@ sub isolate_source_interface( $ ) {
} else {
$iiface = $source;
}
}
( $iiface, $inets );
}
@ -6438,8 +6446,13 @@ sub isolate_dest_interface( $$$$ ) {
} else {
$diface = $dest;
}
} elsif ( $dest =~ /^(.+?):<(.+)>\s*$/ ||
$dest =~ /^(.+?):\[(.+)\]\s*$/ ||
} else {
$dest =~ tr/<>/[]/;
if ( $dest =~ /^(.+?):(\[(?:.+)\],\[(?:.+)\])$/ ) {
$diface = $1;
$dnets = $2;
} elsif ( $dest =~ /^(.+?):\[(.+)\]\s*$/ ||
$dest =~ /^(.+?):(!?\+.+)$/ ||
$dest =~ /^(.+?):(!?[&%].+)$/ ||
$dest =~ /^(.+?):(\[.+\]\/(?:\d+))\s*$/
@ -6447,7 +6460,9 @@ sub isolate_dest_interface( $$$$ ) {
$diface = $1;
$dnets = $2;
} elsif ( $dest =~ /:/ ) {
if ( $dest =~ /^<(.+)>$/ || $dest =~ /^\[(.+)\]$/ ) {
if ( $dest =~ /^\[(?:.+)\],\[(?:.+)\]$/ ){
$dnets = $dest;
} elsif ( $dest =~ /^\[(.+)\]$/ ) {
$dnets = $1;
} else {
$dnets = $dest;
@ -6457,6 +6472,7 @@ sub isolate_dest_interface( $$$$ ) {
} else {
$diface = $dest;
}
}
( $diface, $dnets, $rule );
}