Subject: | IO-Socket-INET6 bug: incorrectly query "127.0.0.1" as a domain name against the local domain |
Date: | Sat, 6 Mar 2010 10:02:51 +0100 |
To: | bug-IO-Socket-INET6 [...] rt.cpan.org |
From: | Luigi Lauro <luigi.lauro [...] gmail.com> |
The actual bug lies in module IO::Socket::INET6 in sub configure.
My nameserver entry in /etc/resolv.conf is 127.0.0.1 .
The configure() is trying to figure out which protocol family to use,
so it tries both, the AF_INET6, then AF_INET. Code near line 192 is:
192: @rres = getaddrinfo(
193: $raddr,$rport,$fam,$type,$proto,AI_PASSIVE
194: );
Since getaddrinfo is told to try AF_INET6 first but is given 0.0.0.0.
and 127.0.0.1
as $raddr, it decides it is not an IPv6 address, and tries to resolve it!
My DNS server is configured to resolve ANY *.mydomain to my external
public IPv4/IPv6 addresses.
So IO-Socket-INET6 query my external DNS server (which is NOT
recursive, but only authoritative)
instead of the given 127.0.0.1 and therefore fails.
You can read about all the details here:
http://www.mail-archive.com/users@spamassassin.apache.org/msg71672.html
I think the best fix is treating 127.0.0.1, 0.0.0.0, ::1 as special
cases and not trying to resolve them, but use them as IP (they are IP
after all...).
Afterall no one would ever use 127.0.0.1.mydomain.com or
0.0.0.0.mydomain.com as valid DNS names.
--
Luigi Lauro