Skip Menu |

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

Report information
The Basics
Id: 119958
Status: new
Priority: 0/
Queue: Net-IP

People
Owner: Nobody in particular
Requestors: me [...] eboxr.com
Cc:
AdminCc:

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



Subject: Net::IP::ip_iptobin does not work on IPv6 as documented
From the documentation seems like ip_iptobin can handle IPv4 and IPv6. I'm using Net::IP 1.26 with perl 5.24. I probably do something wrong but here are my results using an IPv6, whereas it works fine with an IPv4, am I using it incorrectly or is this a bug in Net::IP ? perl -MNet::IP -E 'say Net::IP::ip_bintoip ( Net::IP::ip_iptobin ( q{fdfe::5a55:caff:fefa:9089}, 6), 6)' perl -MNet::IP -E 'say Net::IP::ip_bintoip ( Net::IP::ip_iptobin ( q{10.1.2.3}, 4), 4)' 10.1.2.3 perl -MNet::IP -E 'say defined Net::IP::ip_iptobin ( q{fdfe::5a55:caff:fefa:9089}, 6) ? 1 : 0' 0 perl -MNet::IP -E 'say defined Net::IP::ip_iptobin ( q{2620:0:28a0:2107:5054:ff:fe00:d9c5}, 6) ? 1 : 0' 0
In fact using ip_expand_address solves the issue by making sure we have a fully qualified IPv6 address, I wonder if this should not be done automagically for us At least the documentation should be updated pointing this out. On Tue Jan 24 11:10:38 2017, atoomic wrote: Show quoted text
> From the documentation seems like ip_iptobin can handle IPv4 and IPv6. > I'm using Net::IP 1.26 with perl 5.24. > > I probably do something wrong but here are my results using an IPv6, > whereas it works fine with an IPv4, > am I using it incorrectly or is this a bug in Net::IP ? > > perl -MNet::IP -E 'say Net::IP::ip_bintoip ( Net::IP::ip_iptobin ( > q{fdfe::5a55:caff:fefa:9089}, 6), 6)' > > perl -MNet::IP -E 'say Net::IP::ip_bintoip ( Net::IP::ip_iptobin ( > q{10.1.2.3}, 4), 4)' > 10.1.2.3 > > perl -MNet::IP -E 'say defined Net::IP::ip_iptobin ( > q{fdfe::5a55:caff:fefa:9089}, 6) ? 1 : 0' > 0 > > perl -MNet::IP -E 'say defined Net::IP::ip_iptobin ( > q{2620:0:28a0:2107:5054:ff:fe00:d9c5}, 6) ? 1 : 0' > 0