Skip Menu |

This queue is for tickets about the NetAddr-IP CPAN distribution.

Report information
The Basics
Id: 74192
Status: rejected
Priority: 0/
Queue: NetAddr-IP

People
Owner: Nobody in particular
Requestors: gregoa [...] debian.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From: gregoa [...] cpan.org
Subject: libnetaddr-ip-perl: ip->addr() should follow RFC5952 Section 2.2 (Zero Compression)
This bug has been forwarded from http://bugs.debian.org/656605 Package: libnetaddr-ip-perl Version: 4.058+dfsg-2 Severity: normal Hi, libnetaddr-ip-perls ->addr function should follow the recommended representation in RFC5952, not only print lowercase as default (i have seen the qw(:lower) switch) but also use maximum zero compression as in 2.2 of the RFC5952: Show quoted text
--------------------------------------- quote ----------------------------------- 2.2. Zero Compression 'A special syntax is available to compress the zeros. The use of "::" indicates one or more groups of 16 bits of zeros.' It is possible to select whether or not to omit just one 16-bit 0 field. 2001:db8:aaaa:bbbb:cccc:dddd::1 2001:db8:aaaa:bbbb:cccc:dddd:0:1 In cases where there is more than one field of only zeros, there is a choice of how many fields can be shortened. 2001:db8:0:0:0::1 2001:db8:0:0::1 2001:db8:0::1 2001:db8::1 In addition, Section 2.2 of [RFC4291] notes, 'The "::" can only appear once in an address.' This gives a choice on where in a single address to compress the zero. 2001:db8::aaaa:0:0:1 2001:db8:0:0:aaaa::1
--------------------------------------- quote ----------------------------------- Thanks in advance, gregor herrmann, Debian Perl Group
The upper/lower case issue predates the RFC you refer to and its immediate predecessors. When NetAddr::IP added support for IPV6, all the rfc documentation showed addresses in UPPER case and did not specify a preference for case. We opted to not change the standard way in which NetAddr::IP does this so that we would not break anyone's existing code that might be case sensitive. Instead, the pre-load directives :upper and :lower were added so new code could use the newer rfc standard notation if desired by simply including :lower in the use NetAdder::IP qw :lower whatever... } statement when invoking the NetAddr::IP module. With respect to the section 2.2 compression. We consider this to be a "pretty text" issue. In the sub module NetAddr::IP::InetBase, the function "packzeros" will pretty up the text representation to conform to 2.2 at the cost of many cpu cycles -- which is substantial beyond the conversion of the binary IPV6 representation to text. For ordinary processing of data, even in text form this is highly in-efficent so we have not adopted compressed "pretty text" as a standard, opting instead for quickly converted standard length strings. Programers wishing pretty IPV6 strings at the expense of slower code can add the packzeros function call to their programs that output text for human readers. Best regards, Michael On Fri Jan 20 16:27:20 2012, GREGOA wrote: Show quoted text
> This bug has been forwarded from http://bugs.debian.org/656605 > > Package: libnetaddr-ip-perl > Version: 4.058+dfsg-2 > Severity: normal > > > Hi, > > libnetaddr-ip-perls ->addr function should follow the recommended > representation in RFC5952, > not only print lowercase as default (i have seen the qw(:lower) > switch) but also use > maximum zero compression as in 2.2 of the RFC5952: > > --------------------------------------- quote > ----------------------------------- > 2.2. Zero Compression > > > 'A special syntax is available to compress the zeros. The use > of > "::" indicates one or more groups of 16 bits of zeros.' > > It is possible to select whether or not to omit just one 16-bit 0 > field. > > 2001:db8:aaaa:bbbb:cccc:dddd::1 > > 2001:db8:aaaa:bbbb:cccc:dddd:0:1 > > In cases where there is more than one field of only zeros, there is > a > choice of how many fields can be shortened. > > 2001:db8:0:0:0::1 > > 2001:db8:0:0::1 > > 2001:db8:0::1 > > 2001:db8::1 > > In addition, Section 2.2 of [RFC4291] notes, > > 'The "::" can only appear once in an address.' > > This gives a choice on where in a single address to compress the > zero. > > 2001:db8::aaaa:0:0:1 > > 2001:db8:0:0:aaaa::1 > --------------------------------------- quote > ----------------------------------- > > > > > Thanks in advance, > gregor herrmann, Debian Perl Group
Subject: Re: [rt.cpan.org #74192] libnetaddr-ip-perl: ip->addr() should follow RFC5952 Section 2.2 (Zero Compression)
Date: Sun, 22 Jan 2012 13:31:57 +0100
To: Michael Robinton via RT <bug-NetAddr-IP [...] rt.cpan.org>
From: gregor herrmann <gregoa [...] debian.org>
On Fri, 20 Jan 2012 18:16:05 -0500, Michael Robinton via RT wrote: Show quoted text
Thanks for taking the time to explain this case in detail! Cheers, gregor -- .''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06 : :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe `- NP: Sting: If I Ever Lose My Faith In You
Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.

No problem. All your points are good one's, just trying to keep NetAddr::IP as useful as possible. Best regards, Michael On Sun Jan 22 07:32:33 2012, gregoa@debian.org wrote: Show quoted text
> On Fri, 20 Jan 2012 18:16:05 -0500, Michael Robinton via RT wrote: > > > Thanks for taking the time to explain this case in detail! > > Cheers, > gregor >