From: Evan Hunt Date: Fri, 27 Sep 2019 20:28:09 +0000 (-0700) Subject: SERVFAIL if a prior qmin fetch has not been canceled when a new one starts X-Git-Tag: v9.14.7~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b63214252676ef8391afd5e349b84e94837776a5;p=thirdparty%2Fbind9.git SERVFAIL if a prior qmin fetch has not been canceled when a new one starts (cherry picked from commit 488cb4da1051b3829e20ba3a47d8c11a91eccbcf) --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index bd55c197d05..37e1e3e5d3e 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -4047,6 +4047,35 @@ fctx_try(fetchctx_t *fctx, bool retrying, bool badcache) { if (fctx->minimized && !fctx->forwarding) { unsigned int options = fctx->options; options &= ~DNS_FETCHOPT_QMINIMIZE; + + /* + * Is another QNAME minimization fetch still running? + */ + if (fctx->qminfetch != NULL) { + bool validfctx = (DNS_FETCH_VALID(fctx->qminfetch) && + VALID_FCTX(fctx->qminfetch->private)); + char namebuf[DNS_NAME_FORMATSIZE]; + char typebuf[DNS_RDATATYPE_FORMATSIZE]; + + dns_name_format(&fctx->qminname, namebuf, + sizeof(namebuf)); + dns_rdatatype_format(fctx->qmintype, typebuf, + sizeof(typebuf)); + + isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, + DNS_LOGMODULE_RESOLVER, ISC_LOG_ERROR, + "fctx %p(%s): attempting QNAME " + "minimization fetch for %s/%s but " + "fetch %p(%s) still running", + fctx, fctx->info, namebuf, typebuf, + fctx->qminfetch, + validfctx + ? fctx->qminfetch->private->info + : ""); + fctx_done(fctx, DNS_R_SERVFAIL, __LINE__); + return; + } + /* * In "_ A" mode we're asking for _.domain - * resolver by default will follow delegations