From deb45c5a27ec35f4c4e0be9cb425a7862fa65a61 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 23 Nov 2009 15:57:12 -0800 Subject: [PATCH] Yet another IPv6 Address Normalization fix --- Shorewall/Perl/Shorewall/IPAddrs.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Shorewall/Perl/Shorewall/IPAddrs.pm b/Shorewall/Perl/Shorewall/IPAddrs.pm index 1e962d165..7076618d4 100644 --- a/Shorewall/Perl/Shorewall/IPAddrs.pm +++ b/Shorewall/Perl/Shorewall/IPAddrs.pm @@ -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;