public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Don't reject name server due to empty answer
@ 2010-03-16 17:17 Andreas Schwab
  2010-03-17 14:20 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2010-03-16 17:17 UTC (permalink / raw)
  To: libc-hacker

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-17 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-16 17:17 [PATCH] Don't reject name server due to empty answer Andreas Schwab
2010-03-17 14:20 ` Ulrich Drepper

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