浏览代码

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 年之前
父节点
当前提交
e83b4786d7
共有 1 个文件被更改,包括 4 次插入0 次删除
  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 */