return KR_STATE_DONE;
}
- /**** 1b. otherwise, find the longest prefix NS/xNAME (with OK time+rank). [...] */
+ /**** 1b. otherwise, find the longest prefix zone/xNAME (with OK time+rank). [...] */
k->zname = qry->sname;
ret = kr_dname_lf(k->buf, k->zname, false); /* LATER(optim.): probably remove */
if (unlikely(ret)) {
switch (k->type) {
case KNOT_RRTYPE_CNAME: {
const knot_db_val_t v = el[EL_CNAME];
- const int32_t new_ttl = get_new_ttl(v.data, qry,
- qry->sname, KNOT_RRTYPE_CNAME, qry->timestamp.tv_sec);
+ assert(v.data && v.len);
+ const int32_t new_ttl = get_new_ttl(v.data, qry, qry->sname,
+ KNOT_RRTYPE_CNAME, qry->timestamp.tv_sec);
ret = answer_simple_hit(ctx, pkt, KNOT_RRTYPE_CNAME, v.data,
v.data + v.len, new_ttl);
/* TODO: ^^ cumbersome code; we also recompute the TTL */
if (ret) return ctx->state;
#endif
- /** Collecting multiple NSEC* + RRSIG records, in preparation for the answer
- * + track the progress */
+ /** Structure for collecting multiple NSEC* + RRSIG records,
+ * in preparation for the answer, and for tracking the progress. */
struct answer ans;
memset(&ans, 0, sizeof(ans));
ans.mm = &pkt->mm;
if (ret) return ctx->state;
}
-
/* Find our target RCODE. */
int real_rcode;
switch (ans.rcode) {
if (qry->flags.DNSSEC_INSECURE) {
qry->flags.DNSSEC_WANT = false;
}
- VERBOSE_MSG(qry, "=> satisfied by exact RR or CNAME: rank 0%.2o, new TTL %d\n",
+ VERBOSE_MSG(qry, "=> satisfied by exact %s: rank 0%.2o, new TTL %d\n",
+ (type == KNOT_RRTYPE_CNAME ? "CNAME" : "RRset"),
eh->rank, new_ttl);
return kr_ok();
}
return ret;
}
-/** Find the longest prefix NS/xNAME (with OK time+rank), starting at k->*.
+/** Find the longest prefix zone/xNAME (with OK time+rank), starting at k->*.
* We store xNAME at NS type to lower the number of searches.
* CNAME is only considered for equal name, of course.
* We also store NSEC* parameters at NS type; probably the latest two will be kept.