Yet another IPv6 Address Normalization fix

This commit is contained in:
Tom Eastep 2009-11-23 15:57:12 -08:00
parent bdb673a642
commit deb45c5a27

View File

@ -550,11 +550,12 @@ sub normalize_6addr( $ ) {
$addr =~ s/^:/0:/;
$addr =~ s/:$/:0/;
while ( $addr =~ tr/:/:/ < 7 ) {
$addr =~ s/::/:0::/;
}
$addr =~ s/::/:0:/;
$addr =~ s/::/:0::/ while $addr =~ tr/:/:/ < 7;
#
# Note: "s/::/:0:/g" doesn't work here
#
1 while $addr =~ s/::/:0:/;
$addr =~ s/^0+:/0:/;
$addr;