Merge branch '1191-qmin-fetch-failure' into 'master'

SERVFAIL if a prior qmin fetch has not been canceled when a new one starts

See merge request isc-projects/bind9!2416
This commit is contained in:
Evan Hunt 2019-10-02 00:13:07 -04:00
commit 3520d62b07
2 changed files with 33 additions and 0 deletions

View file

@ -1,3 +1,7 @@
5297. [bug] Check whether a previous QNAME minimization fetch
is still running before starting a new one; return
SERVFAIL and log an error if so. [GL #1191]
5296. [placeholder]
5295. [cleanup] Split dns_name_copy() calls into dns_name_copy() and

View file

@ -4028,6 +4028,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
: "<invalid>");
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
return;
}
/*
* In "_ A" mode we're asking for _.domain -
* resolver by default will follow delegations