am e5477f83: Fail queries fast if no DNS servers are configured.
* commit 'e5477f83b0a639b86d8cbe710f25d9808a8f72af': Fail queries fast if no DNS servers are configured.
This commit is contained in:
commit
8a94b864bf
@ -402,6 +402,10 @@ res_nsend(res_state statp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (statp->nscount == 0) {
|
if (statp->nscount == 0) {
|
||||||
|
// We have no nameservers configured, so there's no point trying.
|
||||||
|
// Tell the cache the query failed, or any retries and anyone else asking the same
|
||||||
|
// question will block for PENDING_REQUEST_TIMEOUT seconds instead of failing fast.
|
||||||
|
_resolv_cache_query_failed(statp->netid, buf, buflen);
|
||||||
errno = ESRCH;
|
errno = ESRCH;
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user