Created attachment 6909
Test program demonstrating getaddrinfo issue
With today's master, getaddrinfo with AI_CANONNAME yields the right ai_canonname (the result of CNAME resolution but not PTR lookup) if no other hint fields are given. However, if hint.ai_family is set to INET6, it appears to do a PTR lookup. The attached test program demonstrates the problem (the first and third output lines in particular):
$ ./a.out ptr-mismatch.kerberos.org
AI_CANONNAME alone: www.kerberos.org
AI_ADDRCONFIG also: www.kerberos.org
ai_family AF_INET : KERBEROS-ORG.MIT.EDU
ai_family AF_INET6: Name or service not known
Created attachment 6909
Test program demonstrating getaddrinfo issue
With today's master, getaddrinfo with AI_CANONNAME yields the right ai_canonname (the result of CNAME resolution but not PTR lookup) if no other hint fields are given. However, if hint.ai_family is set to INET6, it appears to do a PTR lookup. The attached test program demonstrates the problem (the first and third output lines in particular):
$ ./a.out ptr-mismatch. kerberos. org ORG.MIT. EDU
AI_CANONNAME alone: www.kerberos.org
AI_ADDRCONFIG also: www.kerberos.org
ai_family AF_INET : KERBEROS-
ai_family AF_INET6: Name or service not known