From: Vladimír Čunát Date: Fri, 19 May 2017 12:59:39 +0000 (+0200) Subject: ranked rrarray: don't merge RRSIGs of different types X-Git-Tag: v1.3.0~14^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1480a069f9a85c9494a7015c486c97b155c3b5ef;p=thirdparty%2Fknot-resolver.git ranked rrarray: don't merge RRSIGs of different types For example, kr_rrmap_add has been relying on sets covering just a single type (for years). It's used by cache and there it's required to store types separately. It seems all other parts of code should be just OK with this. --- diff --git a/lib/utils.c b/lib/utils.c index c528c6dd4..99d9398eb 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -486,6 +486,13 @@ int kr_ranked_rrarray_add(ranked_rr_array_t *array, const knot_rrset_t *rr, if (stashed->rr->rclass == rr->rclass && stashed->rr->type == rr->type && knot_dname_is_equal(stashed->rr->owner, rr->owner)) { + /* Don't merge RRSIGs covering different types. + * Cache-related code relies on that. */ + if (rr->type == KNOT_RRTYPE_RRSIG && + knot_rrsig_type_covered(&rr->rrs, 0) + != knot_rrsig_type_covered(&stashed->rr->rrs, 0)) { + continue; + } assert(stashed->rank == rank && stashed->cached == false && stashed->to_wire == to_wire);