summaryrefslogtreecommitdiff
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 320aec4f5..6a9b80791 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1432,9 +1432,11 @@ int attribute_hidden __dns_lookup(const char *name,
if (packet_len < HFIXEDSZ) {
/* too short!
+ * If the peer did shutdown then retry later,
+ * try next peer on error.
* it's just a bogus packet from somewhere */
bogus_packet:
- if (reply_timeout)
+ if (packet_len >= 0 && reply_timeout)
goto wait_again;
goto try_next_server;
}