Skip Menu |

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

Report information
The Basics
Id: 94411
Status: rejected
Worked: 15 min
Priority: 0/
Queue: NetAddr-IP

People
Owner: Nobody in particular
Requestors: kdeugau [...] vianet.ca
Cc:
AdminCc:

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



Subject: Very narrow input bug or Easter egg on non-IP input
Date: Thu, 03 Apr 2014 17:45:04 -0400
To: bug-NetAddr-IP [...] rt.cpan.org
From: Kris Deugau <kdeugau [...] vianet.ca>
I've come across something that's either a bug or an Easter egg - I'm not sure which. It came up in a long-shot coincidence in my test data. When you feed this string to new(): knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa it creates a NetAddr::IP for 192.168.7.6/32. Any single-character changes whitespace at the beginning or end, and various substrings I've tried result in no NetAddr::IP object, as I would expect on a more or less random string. -kgd
Subject: Re: [rt.cpan.org #94411] Very narrow input bug or Easter egg on non-IP input
Date: Thu, 3 Apr 2014 14:59:32 -0700
To: bug-NetAddr-IP [...] rt.cpan.org
From: Luis Muñoz <lem [...] itverx.com.ve>
On Apr 3, 2014, at 2:45 PM, Kris Deugau via RT <bug-NetAddr-IP@rt.cpan.org> wrote: Show quoted text
> When you feed this string to new(): > > knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa > > it creates a NetAddr::IP for 192.168.7.6/32.
And I suppose that knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa does not resolve to anything where you're running your test? $ perl -MNetAddr::IP -e 'print NetAddr::IP->new("knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa") // "undef", "\n"' undef Best regards -lem
On Thu Apr 03 17:45:22 2014, kdeugau@vianet.ca wrote: Show quoted text
> I've come across something that's either a bug or an Easter egg - I'm > not sure which. It came up in a long-shot coincidence in my test data. > > When you feed this string to new(): > > knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa > > it creates a NetAddr::IP for 192.168.7.6/32. > > Any single-character changes whitespace at the beginning or end, and > various substrings I've tried result in no NetAddr::IP object, as I > would expect on a more or less random string. > > -kgd
When I try this string here I get no result. The response when you feed a "domain name" to NetAddr::IP is entirely dependent on what is returned by the resolver. The string above will make a call to one or both of gethostbyname and the ipv6 version of gethostbyname if it is present on the system in use. Garbage in, garbage out. Do a lookup locally for that domain string and see what is returned. Based on that, NetAddr::IP will behave accordingly.
Subject: Re: [rt.cpan.org #94411] Very narrow input bug or Easter egg on non-IP input
Date: Fri, 04 Apr 2014 15:49:11 -0400
To: bug-NetAddr-IP [...] rt.cpan.org
From: Kris Deugau <kdeugau [...] vianet.ca>
Luis Muñoz via RT wrote: Show quoted text
> And I suppose that knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa does not resolve to anything where you're running your test? > > $ perl -MNetAddr::IP -e 'print NetAddr::IP->new("knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa") // "undef", "\n"' > undef
My apologies; I've checked again as above on systems further outside my development space and they all come up undef. Rechecking my test data reminded me that that FQDN -> IP is in fact present in the DNS environment. After re-reading code in IP/Lite.pm several times over I see where this is done, but I don't see a way to disable this (either on module load or on object creation). I'll start thinking about a patch to make the docs a bit clearer (this behaviour is hinted at but only vaguely, so far as I read it) and maybe one to disable this feature if/when needed. -kgd
Subject: Re: [rt.cpan.org #94411] Very narrow input bug or Easter egg on non-IP input
Date: Fri, 4 Apr 2014 14:17:46 -0700
To: bug-NetAddr-IP [...] rt.cpan.org
From: Luis Muñoz <lem [...] itverx.com.ve>
On Apr 4, 2014, at 12:49 PM, Kris Deugau via RT <bug-NetAddr-IP@rt.cpan.org> wrote: Show quoted text
> I'll start thinking about a patch to make the docs a bit clearer (this > behaviour is hinted at but only vaguely, so far as I read it) and maybe > one to disable this feature if/when needed.
Could be a good idea. However, note that Show quoted text
> knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa
Is a perfectly valid host name. Best regards -lem
On Fri Apr 04 17:18:16 2014, lem@itverx.com.ve wrote: Show quoted text
> > On Apr 4, 2014, at 12:49 PM, Kris Deugau via RT <bug-NetAddr- > IP@rt.cpan.org> wrote: >
> > I'll start thinking about a patch to make the docs a bit clearer > > (this > > behaviour is hinted at but only vaguely, so far as I read it) and > > maybe > > one to disable this feature if/when needed.
> > Could be a good idea. However, note that >
> > knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa
> > Is a perfectly valid host name. > > Best regards > > -lem
By popular request ;-) I've added a bit of documentation on this feature and a switch to turn it off. New distro uploaded to CPAN