Commit e4931584 authored by Ondřej Surý's avatar Ondřej Surý Committed by Michał Kępień
Browse files

Enable lame response detection even with disabled lame cache

Previously, when lame cache would be disabled by setting lame-ttl to 0,
it would also disable lame answer detection.  In this commit, we enable
the lame response detection even when the lame cache is disabled.  This
enables stopping answer processing early rather than going through the
whole answer processing flow.
parent 8fe18c05
...@@ -10216,26 +10216,27 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) { ...@@ -10216,26 +10216,27 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) {
*/ */
static isc_result_t static isc_result_t
rctx_lameserver(respctx_t *rctx) { rctx_lameserver(respctx_t *rctx) {
isc_result_t result; isc_result_t result = ISC_R_SUCCESS;
fetchctx_t *fctx = rctx->fctx; fetchctx_t *fctx = rctx->fctx;
resquery_t *query = rctx->query; resquery_t *query = rctx->query;
if (fctx->res->lame_ttl == 0 || ISFORWARDER(query->addrinfo) || if (ISFORWARDER(query->addrinfo) || !is_lame(fctx, query->rmessage)) {
!is_lame(fctx, query->rmessage))
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
inc_stats(fctx->res, dns_resstatscounter_lame); inc_stats(fctx->res, dns_resstatscounter_lame);
log_lame(fctx, query->addrinfo); log_lame(fctx, query->addrinfo);
result = dns_adb_marklame(fctx->adb, query->addrinfo, &fctx->name, if (fctx->res->lame_ttl != 0) {
fctx->type, rctx->now + fctx->res->lame_ttl); result = dns_adb_marklame(fctx->adb, query->addrinfo,
&fctx->name, fctx->type,
rctx->now + fctx->res->lame_ttl);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
"could not mark server as lame: %s", "could not mark server as lame: %s",
isc_result_totext(result)); isc_result_totext(result));
} }
rctx->broken_server = DNS_R_LAME; rctx->broken_server = DNS_R_LAME;
rctx->next_server = true; rctx->next_server = true;
FCTXTRACE("lame server"); FCTXTRACE("lame server");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment