SA Bugzilla – Bug 4417
DnsResolver.pm/connect_sock() fails on IPv6 resolver address
Last modified: 2005-06-21 08:06:53 UTC
The code section in DnsResolver.pm/connect_sock: $self->{sock} = $sock; $self->{dest} = sockaddr_in($self->{res}->{port}, inet_aton($self->{res}->{nameservers}[0])); fails because $self->{res}->{nameservers}[0] is a string "::1" and inet_aton does not recognize IPv6 syntax. environment: spamassassin_20050620223535 (SVN), Net::DNS 0.51, IPv6-enabled OS, module IO::Socket::INET6 installed, /etc/resolv.conf contains entry: nameserver ::1 The problem is easily repeatable: $ spamassassin -tD [50765] dbg: logger: adding facilities: all [50765] dbg: logger: logging level is DBG [50765] dbg: generic: SpamAssassin version 3.1.0-pre2-r191258 ... [50765] dbg: dns: is Net::DNS::Resolver available? yes [50765] dbg: dns: Net::DNS version: 0.51 [50765] warn: Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/5.8.6/mach/Socket.pm line 373. Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/local/lib/perl5/5.8.6/mach/Socket.pm line 373. It is interesting that this used to work (with IPv6 resolver) with somewhat older SVN version of SA (spamassassin_20050526104220). Note that the current Net::DNS 0.51 does support IPv6 resolvers when module IO::Socket::INET6 is installed. Seems to be the SA-supplied wrapper/replacement routines in DnsResolver.pm try to over-optimize what is available and working in Net::DNS. A workaround is to remove the "nameserver ::1" entry from /etc/resolv.conf and provide only IPv4 addresses of resolvers. Unfortunately this also affects other applications on the host. Regards Mark
Sorry for a re-post, I accidentally resubmitted the same report. Mark *** This bug has been marked as a duplicate of 4412 ***