This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/10128] New: __libc_res_nquery fails if one answer returns NOERROR and the other NOTIMP or FORMERR


Now that the glibc send both IPv4 and IPv6 requests in parallel, name 
resolution does not work anymore on DNS servers returning *two answers*, but 
NOTIMP or FORMERR to the AAAA query and NOERROR on the A query. This is broken 
according to the RFC, but it seems a common mistake among broken DNS software.

The recent changes to switch back to single request mode in case of timeout 
does not work here (as both queries are answered), so I propose the following 
patch below to solve the issue:


2009-05-05  Aurelien Jarno  <aurelien@aurel32.net>

        * resolv/res_query.c (__libc_res_nquery): If one query returns NOTIMP
        or FORMERR and the other NOERROR, don't raise an error.

--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -289,6 +289,10 @@ __libc_res_nquery(res_state statp,
                        break;
                case FORMERR:
                case NOTIMP:
+                       if ((hp->rcode == NOERROR && ntohs (hp->ancount) != 0)
+                           || (hp2->rcode == NOERROR
+                               && ntohs (hp2->ancount) != 0))
+                               goto success;
                case REFUSED:
                default:
                        RES_SET_H_ERRNO(statp, NO_RECOVERY);

-- 
           Summary: __libc_res_nquery fails if one answer returns NOERROR
                    and the other NOTIMP or FORMERR
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: aurelien at aurel32 dot net
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10128

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]