resolve: a name server answering with an error asks the next one (#735)

A reply with no answers and an error code - FORMERR, SERVFAIL, NOTIMP,
REFUSED - ended the resolution as if the name had no address, and the
servers after the one that answered were never asked, so one broken
server made every name it broke fail. Such an answer is passed over for
the next server now; a reply without data, and one that says the name is
not there, still end the search.
This commit is contained in:
Vladimir Dubrovin committed 2026-11-21 13:58:55 +03:00
1 parent 719bbed0e2
commit d0c840766f
3 files changed
+99 -2

No files matched your search

+7 -1
View File
@@ -177,7 +177,13 @@ static uint32_t udpresolvec(struct extparam *c, int af, unsigned char * name, un
continue; /* question does not match the query */
}
if((na = buf[7] + (((unsigned short)buf[6])<<8)) < 1) {
return 0;
switch(buf[3] & 0x0F){
case 0: /* the name has no address */
case 3: /* the name is not there */
return 0;
default: /* the server failed: ask the next one */
continue;
}
}
for(k = 13; k<len && buf[k]; k++) {
}