Bug 4417 - DnsResolver.pm/connect_sock() fails on IPv6 resolver address
Summary: DnsResolver.pm/connect_sock() fails on IPv6 resolver address
Status: RESOLVED DUPLICATE of bug 4412
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC FreeBSD
: P5 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-21 16:02 UTC by Mark Martinec
Modified: 2005-06-21 08:06 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Martinec 2005-06-21 16:02:43 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
Comment 1 Mark Martinec 2005-06-21 16:06:53 UTC
Sorry for a re-post, I accidentally resubmitted the same report. 
 
  Mark 

*** This bug has been marked as a duplicate of 4412 ***