mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 15:59:41 +08:00
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:
1 parent
2a51e0d8d5
commit
3f6755f7fc
2 files changed
+10
-2
No files matched your search
+3
-1
@@ -517,7 +517,9 @@ Use \fBauthcache\fR to speedup authentication. RADIUS feature is currently exper
|
|||||||
.br
|
.br
|
||||||
Nameserver to use for name resolutions. If none specified
|
Nameserver to use for name resolutions. If none specified
|
||||||
system routines for name resolution is
|
system routines for name resolution is
|
||||||
used. Optional port number may be specified.
|
used. A server that answers with an error (FORMERR, SERVFAIL, REFUSED
|
||||||
|
and the like) is passed over for the next one, while a name answered
|
||||||
|
with no data, or as not there, ends the search. Optional port number may be specified.
|
||||||
If optional /tcp is added to IP address, name resolution is
|
If optional /tcp is added to IP address, name resolution is
|
||||||
performed over TCP.
|
performed over TCP.
|
||||||
An IPv6 address has to be enclosed in square brackets:
|
An IPv6 address has to be enclosed in square brackets:
|
||||||
|
|||||||
+7
-1
@@ -156,7 +156,13 @@ uint32_t udpresolve(int af, unsigned char * name, unsigned char * value, uint32_
|
|||||||
continue; /* question does not match the query */
|
continue; /* question does not match the query */
|
||||||
}
|
}
|
||||||
if((na = buf[7] + (((unsigned short)buf[6])<<8)) < 1) {
|
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++) {
|
for(k = 13; k<len && buf[k]; k++) {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user