Browse Source

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>
Waldemar Brodkorb 9 years ago
parent
commit
e83b4786d7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      libc/inet/resolv.c

+ 4 - 0
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 */