Commit 43389b1b authored by Daniel Salzman's avatar Daniel Salzman

internet: solve DS query bellow a delegation point as a delegation

parent 3e6005c5
......@@ -358,10 +358,10 @@ static int name_found(knot_pkt_t *pkt, knotd_qdata_t *qdata)
return follow_cname(pkt, KNOT_RRTYPE_CNAME, qdata);
}
/* DS query is answered normally, but everything else at/below DP
/* DS query at DP is answered normally, but everything else at/below DP
* triggers referral response. */
if (qtype != KNOT_RRTYPE_DS &&
((qdata->extra->node->flags & NODE_FLAGS_DELEG) || qdata->extra->node->flags & NODE_FLAGS_NONAUTH)) {
if (((qdata->extra->node->flags & NODE_FLAGS_DELEG) && qtype != KNOT_RRTYPE_DS) ||
(qdata->extra->node->flags & NODE_FLAGS_NONAUTH)) {
return KNOTD_IN_STATE_DELEG;
}
......
......@@ -69,6 +69,10 @@ f.dname-tree DNAME dname-tree
dname-out DNAME outside.zone.
; DS tests
ds-sub NS dns.net.ds-sub
dns.net.ds-sub A 1.1.1.1
; Fourth level domain with A record
fourth.third.second A 1.1.1.1
......
......@@ -61,6 +61,16 @@ 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)
# Positive (NODATA, at delegation, DS type)
resp = knot.dig("ds-sub.flags", "DS", udp=True)
resp.check(rcode="NOERROR", flags="QR AA", noflags="TC AD RA")
resp.cmp(bind, additional=True)
# Positive (REFERRAL, below delegation, DS type)
resp = knot.dig("net.ds-sub.flags", "DS", 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment