Skip Menu |

This queue is for tickets about the Net-IPv6Addr CPAN distribution.

Report information
The Basics
Id: 79325
Status: resolved
Priority: 0/
Queue: Net-IPv6Addr

People
Owner: Nobody in particular
Requestors: joacim [...] ludd.ltu.se
Cc:
AdminCc:

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



Subject: Bug in in_network()
Date: Fri, 31 Aug 2012 12:18:23 +0200
To: bug-Net-IPv6Addr [...] rt.cpan.org
From: Joacim Haggmark <joacim [...] ludd.ltu.se>
There is a bug when using in_network() with ip-adddress that contains hex numbers that will be more then 5 digits when converting them to decimal. The bug is in in_network_of_size (or in new if it is supposed to support that format). Can be reproduced by: #!/usr/bin/perl use Net::IPv6Addr; my $x = new Net::IPv6Addr("fd00::54:20c:29fe:fe14:ab4b"); $x->in_network("aa:bb:cc:dd::/64"); Patch: *** IPv6Addr.pm.orig Wed Aug 29 17:16:31 2012 --- IPv6Addr.pm Fri Aug 31 12:11:59 2012 *************** *** 746,752 **** $parts[$j] = 0; } } ! return Net::IPv6Addr->new(join(':', @parts)); } =pod --- 746,752 ---- $parts[$j] = 0; } } ! return Net::IPv6Addr->new(sprintf("%04x" x 8, @parts)); } =pod
On Fri Aug 31 06:18:36 2012, joacim@ludd.ltu.se wrote: Show quoted text
> There is a bug when using in_network() with ip-adddress that contains hex > numbers that will be more then 5 digits when converting them to decimal. > The bug is in in_network_of_size (or in new if it is supposed to support > that format). > > Can be reproduced by: > > #!/usr/bin/perl > > use Net::IPv6Addr; > my $x = new Net::IPv6Addr("fd00::54:20c:29fe:fe14:ab4b"); > $x->in_network("aa:bb:cc:dd::/64"); > > Patch: > > *** IPv6Addr.pm.orig Wed Aug 29 17:16:31 2012 > --- IPv6Addr.pm Fri Aug 31 12:11:59 2012 > *************** > *** 746,752 **** > $parts[$j] = 0; > } > } > ! return Net::IPv6Addr->new(join(':', @parts)); > } > > =pod > --- 746,752 ---- > $parts[$j] = 0; > } > } > ! return Net::IPv6Addr->new(sprintf("%04x" x 8, @parts)); > } > > =pod >
I've applied this patch to the module for version 0.3 and added a test. commit 143d35e3dc27832f49a49c0db4afa585c50c6073 (HEAD -> master) Author: Ben Bullock <benkasminbullock@gmail.com> Date: Thu Aug 24 08:58:12 2017 +0900 Patch from Joacim Haggmark I'll mark this bug as resolved, but if this does not resolve the bug or causes other issues, I'll revert this back out again and leave the module as it was, since my main job as comaintainer is just to add the meta files.
On Fri Aug 31 06:18:36 2012, joacim@ludd.ltu.se wrote: Show quoted text
> There is a bug when using in_network() with ip-adddress that contains hex > numbers that will be more then 5 digits when converting them to decimal. > The bug is in in_network_of_size (or in new if it is supposed to support > that format). > > Can be reproduced by: > > #!/usr/bin/perl > > use Net::IPv6Addr; > my $x = new Net::IPv6Addr("fd00::54:20c:29fe:fe14:ab4b"); > $x->in_network("aa:bb:cc:dd::/64"); > > Patch: > > *** IPv6Addr.pm.orig Wed Aug 29 17:16:31 2012 > --- IPv6Addr.pm Fri Aug 31 12:11:59 2012 > *************** > *** 746,752 **** > $parts[$j] = 0; > } > } > ! return Net::IPv6Addr->new(join(':', @parts)); > } > > =pod > --- 746,752 ---- > $parts[$j] = 0; > } > } > ! return Net::IPv6Addr->new(sprintf("%04x" x 8, @parts)); > } > > =pod >
I've applied this patch. commit 143d35e3dc27832f49a49c0db4afa585c50c6073 Author: Ben Bullock <benkasminbullock@gmail.com> Date: Thu Aug 24 08:58:12 2017 +0900 Patch from Joacim Haggmark