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



MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
content-type: text/plain; charset="utf-8"; format="flowed"
X-Virus-Scanned: amavisd-new at markmonitor.com
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id DF7A74D8044 for <bug-Net-IP [...] rt.cpan.org>; Thu, 10 Jan 2008 12:59:43 -0500 (EST)
Received: (qmail 9052 invoked from network); 10 Jan 2008 17:59:42 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 10 Jan 2008 17:59:42 -0000
Received: from mail2.markmonitor.com (HELO mail2.markmonitor.com) (64.124.14.95) by 16.mx.develooper.com (qpsmtpd/0.40-dev) with ESMTP; Thu, 10 Jan 2008 09:59:40 -0800
Received: from localhost (localhost.localdomain [127.0.0.1]) by mail2.markmonitor.com (Postfix) with ESMTP id 84302145A0 for <bug-Net-IP [...] rt.cpan.org>; Thu, 10 Jan 2008 09:59:35 -0800 (PST)
Received: from mail2.markmonitor.com ([127.0.0.1]) by localhost (mail2.mm-corp.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Gr9lbU3FcZI2 for <bug-Net-IP [...] rt.cpan.org>; Thu, 10 Jan 2008 09:59:35 -0800 (PST)
Received: from [66.16.13.45] (static-66-16-13-45.dsl.cavtel.net [66.16.13.45]) by mail2.markmonitor.com (Postfix) with ESMTP id 360C21459D for <bug-Net-IP [...] rt.cpan.org>; Thu, 10 Jan 2008 09:59:35 -0800 (PST)
Delivered-To: cpan-bug+Net-IP [...] diesel.bestpractical.com
User-Agent: Thunderbird 1.5.0.5 (X11/20060719)
Subject: 61-217-102-8.hinet-ip.hinet.net accepted as 61.0.0.0
Return-Path: <allen.chen [...] markmonitor.com>
X-Original-To: bug-Net-IP [...] rt.cpan.org
X-Spam-Check-BY: 16.mx.develooper.com
Date: Thu, 10 Jan 2008 12:59:34 -0500
X-Spam-Level: *
Message-Id: <47865D06.7060401 [...] markmonitor.com>
To: bug-Net-IP [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Allen Chen <allen.chen [...] markmonitor.com>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 696
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.
MIME-Version: 1.0
In-Reply-To: <47865D06.7060401 [...] markmonitor.com>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <47865D06.7060401 [...] markmonitor.com>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-9057-1309055897-869.32232-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 559
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.
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-9057-1309055897-869.32232-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <47865D06.7060401 [...] markmonitor.com> <rt-3.8.HEAD-9057-1309055897-869.32232-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-5427-1442871329-118.32232-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 69
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.