From 1480a069f9a85c9494a7015c486c97b155c3b5ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 19 May 2017 14:59:39 +0200 Subject: [PATCH] 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. --- lib/utils.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.47.2