Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: matti.niemenmaa+perlbugs [...] iki.fi
Cc:
AdminCc:

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



Subject: Net::DNS::Resolver dies on scoped IPv6 nameserver address
Date: Tue, 5 Apr 2016 20:56:28 +0300
To: bug-Net-DNS [...] rt.cpan.org
From: Matti Niemenmaa <matti.niemenmaa+perlbugs [...] iki.fi>
The following test case, specifying an IPv6 scoped address (see RFC 4007) as a nameserver and attempting a query: use Net::DNS; $resolver = new Net::DNS::Resolver (nameservers => 'fe80::%lo'); print $resolver->send('example.com', 'AAAA'); Dies for me with an error in Socket.pm: Bad arg length Socket::pack_sockaddr_in6, length is 0, should be 16 at /usr/lib/perl5/core_perl/Socket.pm line 844. This is with Net::DNS 1.05. With Net::DNS 1.04 there is no error as long as IO::Socket::INET6 is available, so this could be deemed a regression. There was a change in 1.05 to prefer IO::Socket::IP to IO::Socket::INET6 in Net::DNS::Resolver::Base::_create_dst_sockaddr when both are available, but it seems that Socket::inet_pton doesn't understand scoped addresses. This is on Linux 4.4.6 with glibc 2.23 and perl 5.22.1.
From: rwfranks [...] acm.org
On Tue Apr 05 13:56:45 2016, matti.niemenmaa+perlbugs@iki.fi wrote: Show quoted text
> The following test case, specifying an IPv6 scoped address (see RFC > 4007) as a nameserver and attempting a query: > > use Net::DNS; > $resolver = new Net::DNS::Resolver (nameservers => 'fe80::%lo'); > print $resolver->send('example.com', 'AAAA'); > > Dies for me with an error in Socket.pm: > > Bad arg length Socket::pack_sockaddr_in6, length is 0, should be 16 at > /usr/lib/perl5/core_perl/Socket.pm line 844.
Good catch. Attached patch uses Socket::getaddrinfo() instead. Note that this is a different animal from Socket6::getaddrinfo(). The patch is against 1.05_03, but safe to change 1.05 (line 990).
Subject: Base.pm-patch
Download Base.pm-patch
application/octet-stream 897b

Message body not shown because it is not plain text.

Subject: [rt.cpan.org #113579] Net::DNS::Resolver dies on scoped IPv6 nameserver address
Date: Thu, 7 Apr 2016 14:44:53 +0300
To: bug-Net-DNS [...] rt.cpan.org
From: Matti Niemenmaa <matti.niemenmaa+perlbugs [...] iki.fi>
On 2016-04-07 14:19, Dick Franks via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=113579 > > > On Tue Apr 05 13:56:45 2016, matti.niemenmaa+perlbugs@iki.fi wrote:
>> The following test case, specifying an IPv6 scoped address (see RFC >> 4007) as a nameserver and attempting a query: >> >> use Net::DNS; >> $resolver = new Net::DNS::Resolver (nameservers => 'fe80::%lo'); >> print $resolver->send('example.com', 'AAAA'); >> >> Dies for me with an error in Socket.pm: >> >> Bad arg length Socket::pack_sockaddr_in6, length is 0, should be 16 at >> /usr/lib/perl5/core_perl/Socket.pm line 844.
> > Good catch. > > Attached patch uses Socket::getaddrinfo() instead. > Note that this is a different animal from Socket6::getaddrinfo(). > > The patch is against 1.05_03, but safe to change 1.05 (line 990).
The patch fixes my issue, thanks.
Will be fixed in 1.06