From e83b4786d78b97f1657e96c0dfd13f0e9298e55f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 13 Dec 2015 23:42:34 +0100 Subject: 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 Signed-off-by: Waldemar Brodkorb --- libc/inet/resolv.c | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- cgit v1.2.3