CC: | "amcheste [...] gmail.com" <amcheste [...] gmail.com> |
Subject: | ip_compress_address double compresses IPv6 addresses |
Date: | Wed, 30 Jun 2010 16:35:52 -0400 |
To: | "bug-Net-IP [...] rt.cpan.org" <bug-Net-IP [...] rt.cpan.org> |
From: | "Chester, Alan" <Alan.Chester [...] tekelec.com> |
Hello,
When using ip_compress_address I ran into an issue with IPv6 addresses being double compressed. An example would an address like 2001:0:0:1::1 gets compress to 2001::1::1 which is not a valid ipv6 address since there can only be one :: the proper address is 2001:0:0:1::1.
I solved this by using ip_normalize before I compress. This way I know the address is normalized/expanded first before compressed each time.
In order to continue with my development I made a patch and have attached it in this email. However what is your suggested solution?
Here is some information on what I am running:
Data-Validate-IP-0.11
5.8.8
Linux 2.6.18-164.11.1.el5
Thanks,
Alan
Alan Chester
Linux Dist. Dev, TPD/GPS
(o) +1.919.461.6833 | (m) +1.828.308.1105
5200 Paramount Pky | Morrisville, NC | 27612 | USA
Tekelec<http://www.tekelec.com/?rdid=518> | SIP Blog<http://www.tekelec.com/rd/?rdid=519>