From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3577 invoked by alias); 16 Mar 2010 17:17:40 -0000 Received: (qmail 3553 invoked by uid 22791); 16 Mar 2010 17:17:40 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Mar 2010 17:17:34 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2GHHWqV020370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Mar 2010 13:17:33 -0400 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2GHHVpB022255 for ; Tue, 16 Mar 2010 13:17:32 -0400 From: Andreas Schwab To: libc-hacker@sourceware.org Subject: [PATCH] Don't reject name server due to empty answer X-Yow: I'm reporting for duty as a modern person. I want to do the Latin Hustle now! Date: Tue, 16 Mar 2010 17:17:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00007.txt.bz2 The resolver rejects a name server when it responds with an empty reply (both AA and RA flags cleared) like this: $ dig aaaa @134.178.14.1 www.bom.gov.au. ; <<>> DiG 9.6.1-P3-RedHat-9.6.1-16.P3.fc12 <<>> aaaa @134.178.14.1 www.bom.gov.au. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58652 ;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.bom.gov.au. IN AAAA This only happens when using UDP, the TCP query code happily accepts that as a negative reply. Andreas. * resolv/res_send.c (send_dg): Don't reject name server due to empty answer. --- resolv/res_send.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/resolv/res_send.c b/resolv/res_send.c index 845b658..d164b55 100644 --- a/resolv/res_send.c +++ b/resolv/res_send.c @@ -1294,15 +1294,6 @@ send_dg(res_state statp, if (!statp->pfcode) return (0); } - if (anhp->rcode == NOERROR && anhp->ancount == 0 - && anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) { - DprintQ(statp->options & RES_DEBUG, - (stdout, "referred query:\n"), - *thisansp, - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - goto next_ns; - } if (!(statp->options & RES_IGNTC) && anhp->tc) { /* * To get the rest of answer, -- 1.7.0.1 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."