]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
allow the delegation change if NS has both zones and child is in bailiwick
authorMarek Vavruša <mvavrusa@cloudflare.com>
Tue, 28 Aug 2018 17:32:45 +0000 (10:32 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
Previous change required the new delegation to contain QNAME, but
that's not always the case with chasing CNAME chains. This relaxes
the requirement to QNAME from the response packet, so it always
follows the next chased name.

lib/layer/iterate.c

index 06c4012f8f246cfa330bc7cb3c3f024ff59efe1f..3ae1b64b5ec7fdee6b9d29dbd08d7dd52f7a55ca 100644 (file)
@@ -454,7 +454,7 @@ static int process_authority(knot_pkt_t *pkt, struct kr_request *req)
                        const knot_rrset_t *rr = knot_pkt_rr(an, i);
                        if (rr->type == KNOT_RRTYPE_NS
                            && knot_dname_in_bailiwick(rr->owner, qry->zone_cut.name) > 0
-                           && knot_dname_in_bailiwick(rr->owner, qry->sname) >= 0) {
+                           && knot_dname_in_bailiwick(rr->owner, knot_pkt_qname(pkt)) >= 0) {
                                /* NS below cut in authority indicates different authority,
                                 * but same NS set. */
                                qry->zone_cut.name = knot_dname_copy(rr->owner, &req->pool);