diff options
author | Michel Stam <michel@reverze.net> | 2014-02-27 21:42:38 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2014-04-23 15:36:49 +0200 |
commit | 064d18b8e5dc93d33f24d2d46123f71bdb753061 (patch) | |
tree | 193004fdc02647b87aa12a64976aef02f1163f98 | |
parent | 3a3b2e42e5a59bac00a7eefaf030e50e948425e2 (diff) |
resolv: try next server on SERVFAIL
Commit e1420eca7374cd8f583e9d774c890645a205aaee fixed a bug where a
response code should mean the next server is tried. However, it tries
only the next search domain, and never skips to the next server. This
fix makes sure we try the next server on SERVFAIL.
Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | libc/inet/resolv.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 154734dc5..cfc1eee9b 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -1471,9 +1471,11 @@ int __dns_lookup(const char *name, } /* no more search domains to try */ } - /* dont loop, this is "no such host" situation */ - h_errno = HOST_NOT_FOUND; - goto fail1; + if (h.rcode != SERVFAIL) { + /* dont loop, this is "no such host" situation */ + h_errno = HOST_NOT_FOUND; + goto fail1; + } } /* Insert other non-fatal errors here, which do not warrant * switching to next nameserver */ |