From: Michał Kępień Date: Mon, 8 Oct 2018 10:47:28 +0000 (+0200) Subject: Remove the 'want_stale' field from struct query_ctx X-Git-Tag: v9.13.4~116^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3cd868c4b3c5fa510230b858a9b8862710258fb;p=thirdparty%2Fbind9.git Remove the 'want_stale' field from struct query_ctx As the previous commit makes the 'want_stale' field of struct query_ctx redundant, remove it. --- diff --git a/lib/ns/include/ns/query.h b/lib/ns/include/ns/query.h index f3f3b949c0a..04b38f0a315 100644 --- a/lib/ns/include/ns/query.h +++ b/lib/ns/include/ns/query.h @@ -130,19 +130,18 @@ typedef struct query_ctx { unsigned int options; /* DB lookup options */ - bool redirected; /* nxdomain redirected? */ - bool is_zone; /* is DB a zone DB? */ + bool redirected; /* nxdomain redirected? */ + bool is_zone; /* is DB a zone DB? */ bool is_staticstub_zone; - bool resuming; /* resumed from recursion? */ + bool resuming; /* resumed from recursion? */ bool dns64, dns64_exclude, rpz; - bool authoritative; /* authoritative query? */ - bool want_restart; /* CNAME chain or other + bool authoritative; /* authoritative query? */ + bool want_restart; /* CNAME chain or other * restart needed */ - bool need_wildcardproof; /* wilcard proof needed */ - bool nxrewrite; /* negative answer from RPZ */ - bool findcoveringnsec; /* lookup covering NSEC */ - bool want_stale; /* want stale records? */ - bool answer_has_ns; /* NS is in answer */ + bool need_wildcardproof; /* wilcard proof needed */ + bool nxrewrite; /* negative answer from RPZ */ + bool findcoveringnsec; /* lookup covering NSEC */ + bool answer_has_ns; /* NS is in answer */ dns_fixedname_t wildcardname; /* name needing wcard proof */ dns_fixedname_t dsname; /* name needing DS */ diff --git a/lib/ns/query.c b/lib/ns/query.c index 036eb6ce914..df160993396 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -5034,7 +5034,6 @@ qctx_init(ns_client_t *client, dns_fetchevent_t *event, qctx->findcoveringnsec = client->view->synthfromdnssec; qctx->is_staticstub_zone = false; qctx->nxrewrite = false; - qctx->want_stale = false; qctx->answer_has_ns = false; qctx->authoritative = false; } @@ -5524,12 +5523,11 @@ query_lookup(query_ctx_t *qctx) { dns_cache_updatestats(qctx->client->view->cache, result); } - if (qctx->want_stale) { + if ((qctx->client->query.dboptions & DNS_DBFIND_STALEOK) != 0) { char namebuf[DNS_NAME_FORMATSIZE]; bool success; qctx->client->query.dboptions &= ~DNS_DBFIND_STALEOK; - qctx->want_stale = false; if (dns_rdataset_isassociated(qctx->rdataset) && dns_rdataset_count(qctx->rdataset) > 0 && STALE(qctx->rdataset)) { @@ -6654,7 +6652,6 @@ query_usestale(query_ctx_t *qctx) { } if (staleanswersok) { - qctx->want_stale = true; qctx->client->query.dboptions |= DNS_DBFIND_STALEOK; inc_stats(qctx->client, ns_statscounter_trystale); if (qctx->client->query.fetch != NULL) {