]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove the 'want_stale' field from struct query_ctx
authorMichał Kępień <michal@isc.org>
Mon, 8 Oct 2018 10:47:28 +0000 (12:47 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 8 Oct 2018 10:47:28 +0000 (12:47 +0200)
As the previous commit makes the 'want_stale' field of struct query_ctx
redundant, remove it.

lib/ns/include/ns/query.h
lib/ns/query.c

index f3f3b949c0a3ac4d8df3de55ae322aa7a95edaf8..04b38f0a3154aea8431d66dc9e4d007b6840e92b 100644 (file)
@@ -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 */
 
index 036eb6ce914cb68c95a451840d676e1ee210157b..df1609933964c1d183cf28b797a32bc886dac231 100644 (file)
@@ -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) {