[git commit prelink] resolv: try next server on SERVFAIL

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 24 14:27:36 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=0100056707c0ca5c51bb0b8d88612a407be09ef1
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/prelink

in bug 3637 Andrey Kovalev aka pxe.ru writes:
getaddrinfo does NOT add domain to query when receive SERVFAIL

RFC1035 7.2 suggests that
   - If a resolver gets a server error or other bizarre response
     from a name server, it should remove it from SLIST, and may
     wish to schedule an immediate transmission to the next
     candidate server address.

So let's try the next server upon SERVFAIL even if it's not strictly
required.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/inet/resolv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 021d5bf..e8b7f2b 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1461,7 +1461,7 @@ int attribute_hidden __dns_lookup(const char *name,
 		/* bug 660 says we treat negative response as an error
 		 * and retry, which is, eh, an error. :)
 		 * We were incurring long delays because of this. */
-		if (h.rcode == NXDOMAIN) {
+		if (h.rcode == NXDOMAIN || h.rcode == SERVFAIL) {
 			/* if possible, try next search domain */
 			if (!ends_with_dot) {
 				DPRINTF("variant:%d sdomains:%d\n", variant, sdomains);
-- 
1.7.3.4



More information about the uClibc-cvs mailing list