]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
Revert "cache: cache RRSIGs in packet cache"
authorMarek Vavruša <mvavrusa@cloudflare.com>
Thu, 23 Aug 2018 18:29:45 +0000 (11:29 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
This reverts commit bb95021cc8a14082139e795ed500ff4dc22c459c.

lib/cache/api.c
lib/cache/entry_pkt.c

index 52e786869248b9a6fab474850926e31a9670e421..498c1469330f6dc3b8607b2a5808763648406390 100644 (file)
@@ -277,7 +277,8 @@ static bool check_dname_for_lf(const knot_dname_t *n, const struct kr_query *qry
 /** Return false on types to be ignored.  Meant both for sname and direct cache requests. */
 static bool check_rrtype(uint16_t type, const struct kr_query *qry/*logging*/)
 {
-       const bool ret = !knot_rrtype_is_metatype(type);
+       const bool ret = !knot_rrtype_is_metatype(type)
+                       && type != KNOT_RRTYPE_RRSIG;
        if (!ret) { WITH_VERBOSE(qry) {
                auto_free char *type_str = kr_rrtype_text(type);
                VERBOSE_MSG(qry, "=> skipping RR type %s\n", type_str);
@@ -338,6 +339,9 @@ knot_db_val_t key_exact_type_maypkt(struct key *k, uint16_t type, const kr_cache
        }
 
        switch (type) {
+       case KNOT_RRTYPE_RRSIG: /* no RRSIG query caching, at least for now */
+               assert(false);
+               return (knot_db_val_t){ NULL, 0 };
        /* xNAME lumped into NS. */
        case KNOT_RRTYPE_CNAME:
        case KNOT_RRTYPE_DNAME:
index 2e2e5cea26120f59b577fdac3607b5a986331861..ee9ea2e3725be0ec54ba5e333d45b144f953d295 100644 (file)
@@ -63,7 +63,7 @@ void stash_pkt(const knot_pkt_t *pkt, const struct kr_query *qry,
        const struct kr_qflags * const qf = &qry->flags;
        const bool want_negative = qf->DNSSEC_INSECURE || !qf->DNSSEC_WANT || has_optout;
        const bool want_pkt = qf->DNSSEC_BOGUS /*< useful for +cd answers */
-                               || (is_negative && want_negative) || qry->stype == KNOT_RRTYPE_RRSIG;
+                               || (is_negative && want_negative);
 
        if (!want_pkt || !knot_wire_get_aa(pkt->wire)
            || pkt->parsed != pkt->size /*< malformed packet; still can't detect KNOT_EFEWDATA */
@@ -91,10 +91,7 @@ void stash_pkt(const knot_pkt_t *pkt, const struct kr_query *qry,
                        /* All bad cases should be filtered above,
                         * at least the same way as pktcache in kresd 1.5.x. */
                        kr_rank_set(&rank, KR_RANK_SECURE);
-               } else if (qry->stype == KNOT_RRTYPE_RRSIG) {
-                       /* RRSIGs can be at most cached as insecure */
-                       kr_rank_set(&rank, KR_RANK_INSECURE);
-               }
+               } else assert(false);
        }
 
        const uint16_t pkt_type = knot_pkt_qtype(pkt);