summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-06-14 16:31:00 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-06-29 19:22:54 +0200
commite1420eca7374cd8f583e9d774c890645a205aaee (patch)
treedab88867519b2b2f41c7743f7d11c84fc241dcd0
parent117a5d673c50335749fd0e1b41d19230db97b143 (diff)
downloaduClibc-alpine-e1420eca7374cd8f583e9d774c890645a205aaee.tar.bz2
uClibc-alpine-e1420eca7374cd8f583e9d774c890645a205aaee.tar.xz
resolv: try next server on SERVFAIL
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@gmail.com>
-rw-r--r--libc/inet/resolv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 021d5bf5d..e8b7f2bad 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);