[rbldnsd] Disabling ipv6-specific tests

Michael Orlitzky michael at orlitzky.com
Wed Jul 31 04:59:52 MSK 2013


On 07/30/2013 03:27 PM, Jeff Dairiki wrote:
> 
> Two possible fixes:
> 
> Quick-and-dirty:
> 
>   Kluge initsockets() to check for and ignore duplicate IPs returned
>   by gethostbyname().
> 
> Probably the "correct" fix:
> 
>   Use getaddrinfo() (when available) instead of (the deprecated)
>   gethostbyname(), even when -DNO_IPv6 is set.
> 
>   This would require, I think, splitting the functionality of
>   NO_IPv6 into two C defs.  Currently the default state for NO_IPv6
>   is determined by a configure test for getnameinfo/getaddrinfo, but
>   it can be overridden by --enable-ipv6 or --disable-ipv6.  We would
>   need a new macro, say NO_GETADDRINFO which would be set depending
>   solely on the result of the configure test for
>   getnameinfo/getaddrinfo.
> 

I was going to ask why we don't just use the new implementation of
newsocket(). I guess the newer API isn't available everywhere?


> I like the second option better, but, before comitting to that, it's
> worth checking that it would work.
> 
> Please check the output of:
> 
>    python -c "from socket import *; print getaddrinfo('localhost', 5300, 0, AF_INET)"
> 
> It should produce something like (with just a single entry for '127.0.0.1'):
> 
>    [(2, 2, 17, '', ('127.0.0.1', 5300))]
> 

This is what that command outputs:

[(10, 2, 17, '', (10,
'\x14\xb4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')), (2, 2, 17,
'', ('127.0.0.1', 5300))]


> Oop.  Just found this glibc bug report:
>   http://sourceware.org/bugzilla/show_bug.cgi?id=4980
> 
> Apparently this is/was a known bug/not-a-bug in glibc at some
> point. (I can't quite tell if this was eventually "fixed" or not.)  The
> ticket makes for entertaining reading, in any case.

I remember that! Probably from Slashdot. I feel honored to have
triggered it in the wild.



More information about the rbldnsd mailing list