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.