Skip Menu |

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

Report information
The Basics
Id: 21402
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: julian [...] mehnle.net
rwfranks [...] acm.org
Cc:
AdminCc:

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



Subject: IPv4/v6 reverse name generation inconsistent in N:D:R:B::{search,query}() vs. N:D:R:B::send()
Net::DNS::Resolver::Base::query() (and search()) correctly converts IPv4/IPv6 addresses into *.arpa reverse notation. However, send() relies on make_query_packet(), which only converts plain IPv4 addresses. This inconsistent behavior of should be fixed. Either make_query_packet() should not perform such conversions at all, or query() and make_query_packet() should use a common function for such conversions.
From: rwfranks [...] acm.org
Attached patch provides the function you suggest, invoked by make_query_packet(). This will provide the missing IPv6 address conversion for both send() and bgsend(). The wider code commonality issue has not been addressed here. Dick
Download patch20836
application/octet-stream 1.4k

Message body not shown because it is not plain text.

Subject: Unable to prebuild PTR query from IP using Net::DNS::Packet->new()
Perl 5.008008 Linux 2.6.17-1.2174_FC5 i686 Net::DNS 0.58 A user might reasonably expect my $prebuilt_query = Net::DNS::Packet->new( @arglist ); my $ex1 = $resolver->send( $prebuilt_query ); and my $ex2 = $resolver->send( @arglist ); to perform the same query for any valid @arglist. This expectation is not fulfilled when the name argument is an IPv4 or IPv6 address. $prebuilt_query->print; shows what happens ;; HEADER SECTION ;; id = 49388 ;; qr = 0 opcode = QUERY aa = 0 tc = 0 rd = 1 ;; ra = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0 ;; QUESTION SECTION (1 record) ;; 10.2.3.4. IN A ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records)
From: rwfranks [...] acm.org
Attached patch modifies Net::DNS::Question.pm to transform IPv4 or IPv6 address as required for a PTR query. This allows PTR query packets to be prebuilt, and addresses the code commonality issue noted in bug#20836. The search(), query(), send(), bgsend(), Net::DNS::Packet->new() methods are consistent in the form of argument they accept. This is substantially the same as patch provided for #20836, but applied in a more sensible place.
Download patch21402
application/octet-stream 2.3k

Message body not shown because it is not plain text.

From: rwfranks [...] acm.org
This patch should not be used. This problem is addressed more generally by bug#21402.
Patch applied and fixed in 0.59
Patch applied and fixed in 0.59