NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/42405: libc: getaddrinfo() should perform T_A lookups before T_AAAA lookups

>Number:         42405
>Category:       lib
>Synopsis:       libc: getaddrinfo() should perform T_A lookups before T_AAAA 
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 03 19:45:00 +0000 2009
>Originator:     Chuck Swiger
>Release:        5.0
From discussion on netbsd-users mailing list:

Trying to perform A lookups before you try AAAA lookups turns out to resolve 
almost all the problems users were experiencing with sites which do not support 
IPv6 well, and so this became the default behavior on FreeBSD.

See _dns_getaddrinfo() in ; 
this change was made back in 2005.
Use firefox to browse the web and go past popular sites which make use of 
ad-serving domains which do not handle IPv6 requests very well, and note delays 
in page rendering resulting from failing/dropped AAAA lookups.
Starting from

--- getaddrinfo.c~      2009-12-02 12:56:20.000000000 -0800
+++ getaddrinfo.c       2009-12-02 12:57:15.000000000 -0800
@@ -1321,16 +1321,16 @@

        switch (pai->ai_family) {
        case AF_UNSPEC:
-               /* prefer IPv6 */
+               /* prefer IPv4 */
       = name;
                q.qclass = C_IN;
-               q.qtype = T_AAAA;
+               q.qtype = T_A;
                q.answer = buf->buf;
                q.anslen = sizeof(buf->buf);
       = &q2;
       = name;
                q2.qclass = C_IN;
-               q2.qtype = T_A;
+               q2.qtype = T_AAAA;
                q2.answer = buf2->buf;
                q2.anslen = sizeof(buf2->buf);

Home | Main Index | Thread Index | Old Index