From: Petr Menšík Date: Tue, 10 Jun 2025 12:35:03 +0000 (+0200) Subject: Add few extra WANT_QUERYTRACE logs into resume_qmin X-Git-Tag: v9.21.11~61^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2c69662320601d8d20cce132920b4f75217c56f;p=thirdparty%2Fbind9.git Add few extra WANT_QUERYTRACE logs into resume_qmin Print optionally a bit more details not passed to event in case dns_view_findzonecut returns unexpected result. Result would be visible later in foundevent, but found fname would be lost. Print it into the log. --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 8601bcf67d0..a483cc8ea8d 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -101,6 +101,14 @@ isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \ ISC_LOG_DEBUG(3), "fctx %p(%s): %s %s%u", fctx, \ fctx->info, (m1), (m2), (v)) +#define FCTXTRACEN(m1, name, res) \ + do { \ + if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) { \ + char dbuf[DNS_NAME_FORMATSIZE]; \ + dns_name_format((name), dbuf, sizeof(dbuf)); \ + FCTXTRACE4((m1), dbuf, (res)); \ + } \ + } while (0) #define FTRACE(m) \ isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \ ISC_LOG_DEBUG(3), "fetch %p (fctx %p(%s)): %s", fetch, \ @@ -150,6 +158,7 @@ UNUSED(m2); \ UNUSED(v); \ } while (0) +#define FCTXTRACEN(m1, name, res) FCTXTRACE4(m1, name, res) #define FTRACE(m) \ do { \ UNUSED(m); \ @@ -4279,6 +4288,7 @@ resume_qmin(void *arg) { result = dns_view_findzonecut(res->view, fctx->name, fname, dcname, fctx->now, findoptions, true, true, &fctx->nameservers, NULL); + FCTXTRACEN("resume_qmin findzonecut", fname, result); /* * DNS_R_NXDOMAIN here means we have not loaded the root zone @@ -5014,6 +5024,8 @@ clone_results(fetchctx_t *fctx) { /* This is the head resp; keep a pointer and move on */ if (hresp == NULL) { hresp = ISC_LIST_HEAD(fctx->resps); + FCTXTRACEN("clone_results", hresp->foundname, + hresp->result); continue; }