]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
iterate: only pick RRs from the IN class
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 4 Apr 2018 15:42:35 +0000 (17:42 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Mon, 23 Apr 2018 07:48:46 +0000 (09:48 +0200)
lib/layer/iterate.c

index 7a4ad83a91c2cb3687de8b1cc309ac9b46d9eca6..f0823557cc4b04317b2267cdfdf08ab4bdf58586 100644 (file)
@@ -356,7 +356,7 @@ static int pick_authority(knot_pkt_t *pkt, struct kr_request *req, bool to_wire)
 
        for (unsigned i = 0; i < ns->count; ++i) {
                const knot_rrset_t *rr = knot_pkt_rr(ns, i);
-               if (!knot_dname_in(zonecut_name, rr->owner)) {
+               if (rr->rclass != KNOT_CLASS_IN || !knot_dname_in(zonecut_name, rr->owner)) {
                        continue;
                }
                uint8_t rank = get_initial_rank(rr, qry, false,
@@ -492,7 +492,8 @@ static int unroll_cname(knot_pkt_t *pkt, struct kr_request *req, bool referral,
                        const bool type_OK = rr->type == query->stype || type == query->stype
                                || type == KNOT_RRTYPE_CNAME || type == KNOT_RRTYPE_DNAME;
                                /* TODO: actually handle DNAMEs */
-                       if (!type_OK || !knot_dname_is_equal(rr->owner, cname)) {
+                       if (rr->rclass != KNOT_CLASS_IN || !type_OK
+                           || !knot_dname_is_equal(rr->owner, cname)) {
                                continue;
                        }