Commit 238492d5 authored by Filip Široký's avatar Filip Široký

cname for dname if record does not exist, no cname checks

parent 816c475c
......@@ -318,14 +318,6 @@ static int name_found(knot_pkt_t *pkt, knotd_qdata_t *qdata)
{
uint16_t qtype = knot_pkt_qtype(pkt);
if (node_rrtype_exists(qdata->extra->node, KNOT_RRTYPE_CNAME)
&& qtype != KNOT_RRTYPE_CNAME
&& qtype != KNOT_RRTYPE_RRSIG
&& qtype != KNOT_RRTYPE_NSEC
&& qtype != KNOT_RRTYPE_ANY) {
return follow_cname(pkt, KNOT_RRTYPE_CNAME, qdata);
}
/* DS query at DP is answered normally, but everything else at/below DP
* triggers referral response. */
if (((qdata->extra->node->flags & NODE_FLAGS_DELEG) && qtype != KNOT_RRTYPE_DS) ||
......@@ -342,9 +334,15 @@ static int name_found(knot_pkt_t *pkt, knotd_qdata_t *qdata)
return KNOTD_IN_STATE_ERROR;
}
}
/* Check for NODATA (=0 RRs added). */
if (old_rrcount == pkt->rrset_count) {
if (node_rrtype_exists(qdata->extra->node, KNOT_RRTYPE_CNAME)
&& qtype != KNOT_RRTYPE_CNAME
&& qtype != KNOT_RRTYPE_RRSIG
&& qtype != KNOT_RRTYPE_NSEC
&& qtype != KNOT_RRTYPE_ANY) {
return follow_cname(pkt, KNOT_RRTYPE_CNAME, qdata);
}
return KNOTD_IN_STATE_NODATA;
} else {
return KNOTD_IN_STATE_HIT;
......
......@@ -1001,20 +1001,6 @@ static int check_cname(const zone_node_t *node, semchecks_data_t *data)
return KNOT_EOK;
}
unsigned rrset_limit = 1;
/* With DNSSEC node can contain RRSIGs or NSEC */
if (node_rrtype_exists(node, KNOT_RRTYPE_NSEC)) {
rrset_limit += 1;
}
if (node_rrtype_exists(node, KNOT_RRTYPE_RRSIG)) {
rrset_limit += 1;
}
if (node->rrset_count > rrset_limit) {
data->handler->fatal_error = true;
data->handler->cb(data->handler, data->zone, node,
SEM_ERR_CNAME_EXTRA_RECORDS, NULL);
}
if (cname_rrs->rr_count != 1) {
data->handler->fatal_error = true;
data->handler->cb(data->handler, data->zone, node,
......
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