Skip Menu |
 

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

Report information
The Basics
Id: 32232
Status: resolved
Priority: 0/
Queue: Net-IP

People
Owner: Nobody in particular
Requestors: allen.chen [...] markmonitor.com
Cc:
AdminCc:

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



Subject: 61-217-102-8.hinet-ip.hinet.net accepted as 61.0.0.0
Date: Thu, 10 Jan 2008 12:59:34 -0500
To: bug-Net-IP [...] rt.cpan.org
From: Allen Chen <allen.chen [...] markmonitor.com>
Download (untitled) / with headers
text/plain 696b
I use Net::IP to process the host portion of a URL as a test to see if it is an IP address and to normalize it into dotted quad format. If the Net::IP->new() fails, I treat the host as a hostname instead of an IP. Strangely, Net::IP does not return any errors for "61-217-102-8.hinet-ip.hinet.net" and instead parses it as 61.0.0.0. Here is code to reproduce the bug: #!/usr/bin/perl use Net::IP; my $ip = Net::IP->new('61-217-102-8.hinet-ip.hinet.net'); print " IP: " . $ip->ip() . "\n"; print "ERROR: " . Net::IP::Error() . "\n"; print "ERRNO: " . Net::IP::Errno() . "\n"; Here is the output from the above: IP: 61.0.0.0 ERROR: ERRNO: I am using Net::IP 1.25 under perl 5.8.7.
Download (untitled) / with headers
text/plain 559b
On Thu Jan 10 13:00:13 2008, allen.chen@markmonitor.com wrote: Show quoted text
> > Here is code to reproduce the bug: > > #!/usr/bin/perl > use Net::IP; > my $ip = Net::IP->new('61-217-102-8.hinet-ip.hinet.net'); > print " IP: " . $ip->ip() . "\n"; > print "ERROR: " . Net::IP::Error() . "\n"; > print "ERRNO: " . Net::IP::Errno() . "\n";
This is rather misfeature... It takes 61-217 as a range with the trailing garbage. Show quoted text
> print " IP: " . $ip->print() . "\n";
IP: 61.0.0.0 - 217.0.0.0 I don't see how this can be easily addressed without breaking current code.
It seems that other fixes to the code addressed this issue as well.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.