make_query_packet() IP address detection broken

Bug #141546 reported by Scott Kitterman
2
Affects Status Importance Assigned to Milestone
libnet-dns-perl (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: libnet-dns-perl

The IP address detection logic (for PTR query magic) in
 Net::DNS::Resolver::Base::make_query_packet() is seriously broken as of
 Net::DNS 0.60.

 The documentation for Net::DNS::Resolver::send() specifies:

 | The argument list can be either a Net::DNS::Packet object or a list
 | of strings. The record type and class can be omitted; they default to
 | A and IN. If the name looks like an IP address (Ipv4 or IPv6), then
 | an appropriate PTR query will be performed.

 However, "foo:bar/baz.example.com" does NOT look like an IP address!

Setting up libnet-dns-perl (0.60-1) ...
$ perl -MNet::DNS::Resolver -MData::Dumper -e 'my $r = Net::DNS::Resolver->new(); my $packet = $r->make_query_packet("foo:bar/baz.example.com", "A"); print(Dumper($packet->question))'
$VAR1 = bless( {
                 'qclass' => 'IN',
                 'qname' => 'r.a.b.0.o.o.f.0.ip6.arpa',
                 'qtype' => 'PTR'
               }, 'Net::DNS::Question' );

Setting up libnet-dns-perl (0.59-1build1) ...
$ perl -MNet::DNS::Resolver -MData::Dumper -e 'my $r = Net::DNS::Resolver->new(); my $packet = $r->make_query_packet("foo:bar/baz.example.com", "A"); print(Dumper($packet->question))'
$VAR1 = bless( {
                 'qclass' => 'IN',
                 'qname' => 'foo:bar/baz.example.com',
                 'qtype' => 'A'
               }, 'Net::DNS::Question' );

It looks like the problem is a regex that believes that if both ":" and "/" appear in a domain name it must be an IPv6 address. These are both legal.

Upstream bug is https://rt.cpan.org/Public/Bug/Display.html?id=29531 but my LP foo is insuffienct to link to it.

Revision history for this message
Scott Kitterman (kitterman) wrote :

COnfirmed based on upstream bug.

description: updated
Changed in libnet-dns-perl:
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

The domain names are legal, but unlikely to come up very often. Marking low as a result.

Changed in libnet-dns-perl:
importance: Undecided → Low
Revision history for this message
Scott Kitterman (kitterman) wrote :

Fixed in version 0.62.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libnet-dns-perl - 0.62-0ubuntu1

---------------
libnet-dns-perl (0.62-0ubuntu1) hardy; urgency=low

  * New upstream release (LP: #141546)
  * Change maintainer to MOTU
  * Bump standards version to 3.7.3 without further change
  * Remove unneeded debian/dirs file

 -- Scott Kitterman <email address hidden> Tue, 15 Jan 2008 00:32:55 -0500

Changed in libnet-dns-perl:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.