mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-05-28 04:02:31 -04:00
internet: skip empty non-terminal parents during delegation lookup
This commit is contained in:
parent
f31e128e8d
commit
59d110fc4f
3 changed files with 16 additions and 3 deletions
|
|
@ -454,9 +454,16 @@ static int name_not_found(knot_pkt_t *pkt, struct query_data *qdata)
|
|||
return follow_cname(pkt, KNOT_RRTYPE_DNAME, qdata);
|
||||
}
|
||||
|
||||
/* Look up an authoritative encloser or its parent. */
|
||||
const zone_node_t *node = qdata->encloser;
|
||||
while (node->rrset_count == 0 || node->flags & NODE_FLAGS_NONAUTH) {
|
||||
node = node->parent;
|
||||
assert(node);
|
||||
}
|
||||
|
||||
/* Name is below delegation. */
|
||||
if ((qdata->encloser->flags & NODE_FLAGS_DELEG)) {
|
||||
qdata->node = qdata->encloser;
|
||||
if ((node->flags & NODE_FLAGS_DELEG)) {
|
||||
qdata->node = node;
|
||||
return DELEG;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ mail A 192.0.2.3
|
|||
|
||||
; Delegation of a subdomain
|
||||
sub NS ns.sub
|
||||
sub NS sub
|
||||
sub A 192.0.0.1
|
||||
ns.sub A 192.0.2.4
|
||||
|
||||
; CNAME to A record
|
||||
|
|
@ -56,7 +58,6 @@ cname-mx-wc MX 10 cname-wildcard
|
|||
; MX record leading to CNAME (outside zone)
|
||||
cname-mx-out MX 10 cname-out
|
||||
|
||||
|
||||
; DNAME subtree
|
||||
dname DNAME dname-tree
|
||||
dname-tree A 1.2.3.4
|
||||
|
|
|
|||
|
|
@ -56,6 +56,11 @@ resp = knot.dig("ns.sub.flags", "A", udp=True)
|
|||
resp.check(rcode="NOERROR", flags="QR", noflags="AA TC AD RA")
|
||||
resp.cmp(bind, additional=True)
|
||||
|
||||
# Positive (REFERRAL, below delegation, ignoring empty-nonterminal during lookup)
|
||||
resp = knot.dig("bellow.ns.sub.flags", "A", udp=True)
|
||||
resp.check(rcode="NOERROR", flags="QR", noflags="AA TC AD RA")
|
||||
resp.cmp(bind, additional=True)
|
||||
|
||||
''' ANY query type. '''
|
||||
|
||||
# ANY to SOA record
|
||||
|
|
|
|||
Loading…
Reference in a new issue