summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-12-13 23:42:34 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2015-12-17 20:35:20 +0100
commite83b4786d78b97f1657e96c0dfd13f0e9298e55f (patch)
treee9e8e9fbe86fad041076a089f6cc340499a196c1 /libc/inet
parenta574f01947321cfc4dc746db90c2291f3e9f10c2 (diff)
resolv: __dns_lookup - immediately switch to next server in case of poll() set error events
https://bugs.busybox.net/show_bug.cgi?id=3211 Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/resolv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index fffe4281c..8e5a97db0 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1410,6 +1410,10 @@ int __dns_lookup(const char *name,
* to next nameserver */
goto try_next_server;
}
+ if (fds.revents & (POLLERR | POLLHUP | POLLNVAL)) {
+ DPRINTF("Bad event\n");
+ goto try_next_server;
+ }
/*TODO: better timeout accounting?*/
reply_timeout -= 1000;
#endif /* USE_SELECT */