From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4807 invoked by alias); 4 May 2009 22:49:32 -0000 Received: (qmail 4492 invoked by uid 48); 4 May 2009 22:49:21 -0000 Date: Mon, 04 May 2009 22:49:00 -0000 From: "aurelien at aurel32 dot net" To: glibc-bugs@sources.redhat.com Message-ID: <20090504224917.10128.aurelien@aurel32.net> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/10128] New: __libc_res_nquery fails if one answer returns NOERROR and the other NOTIMP or FORMERR X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00008.txt.bz2 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 * 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.