Created attachment 5792 [details] test case glibc 2.14 getaddrinfo succeeds resolving dns entry that has A only record (and no AAAA) even if hits.ai_family was set to AF_INET6. glibc 2.14 (invalid behaviour): $ ./a.out succeeded - BAD! Got 209.132.183.81 port 0 family 2 Got 209.132.183.81 port 0 family 2 Got 209.132.183.81 port 0 family 2 glibc 2.13 (correct behaviour): $ ./a.out failed - OK!: Name or service not known Test programs resolves redhat.com which at this moment has no AAAA record.
This is broken by bug 12714.
I think the patch I applied fixes the problem.
> I think the patch I applied fixes the problem. It may fix the IPv6 problem, but unfortunately it breaks the IPv4 case. % git pull fatal: Unable to look up sourceware.org (port 9418) (No address associated with hostname) ([Errno -5] No address associated with hostname))
Fixed by Andreas' commit.