public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@redhat.com>
To: libc-hacker@sourceware.org
Subject: [PATCH] Don't reject name server due to empty answer
Date: Tue, 16 Mar 2010 17:17:00 -0000	[thread overview]
Message-ID: <m3tysgyymt.fsf@hase.home> (raw)

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."

             reply	other threads:[~2010-03-16 17:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 17:17 Andreas Schwab [this message]
2010-03-17 14:20 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tysgyymt.fsf@hase.home \
    --to=schwab@redhat.com \
    --cc=libc-hacker@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).