Skip Menu |

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

Report information
The Basics
Id: 68723
Status: resolved
Priority: 0/
Queue: NetAddr-IP

People
Owner: Nobody in particular
Requestors: abenea [...] gmail.com
Cc:
AdminCc:

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



Subject: NetAddr::IP->new6 ignores the mask
I am trying to construct a NetAddr::IP object given the numeric representation of the address (ex: 12345) and the prefix (ex: 1). The IPv4 version of new works fine: NetAddr::IP->new(12345, 1) => 0.0.48.57/1 But the IPv6 version ignores the mask specified and uses 128 instead: NetAddr::IP->new6(12345, 1) => 0:0:0:0:0:0:0:3039/128 At first I tried to work around this by including the mask in the first parameter to new6, but this doesn't seem to work (I can't tell if this is a bug or an undocumented feature :) NetAddr::IP->new6("12345/1") => 0:0:0:0:0:0:0:3039/97 The only workaround I found is: NetAddr::IP->new6(NetAddr::IP->new6(12345)->addr . "/1") => 0:0:0:0:0:0:0:3039/1
Fixed in recent releases. Current release 4.049 On Thu Jun 09 16:00:01 2011, abenea wrote: Show quoted text
> I am trying to construct a NetAddr::IP object given the numeric > representation of the address (ex: 12345) and the prefix (ex: 1). > > The IPv4 version of new works fine: > > NetAddr::IP->new(12345, 1) => 0.0.48.57/1 > > But the IPv6 version ignores the mask specified and uses 128 instead: > > NetAddr::IP->new6(12345, 1) => 0:0:0:0:0:0:0:3039/128 > > At first I tried to work around this by including the mask in the first > parameter to new6, but this doesn't seem to work (I can't tell if this > is a bug or an undocumented feature :) > > NetAddr::IP->new6("12345/1") => 0:0:0:0:0:0:0:3039/97 > > The only workaround I found is: > NetAddr::IP->new6(NetAddr::IP->new6(12345)->addr . "/1") => > 0:0:0:0:0:0:0:3039/1 >