Skip to content
Snippets Groups Projects
Commit a89efa5c authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Fixed getting previous node for NSEC.

parent 17aad6b1
No related branches found
No related tags found
No related merge requests found
......@@ -969,9 +969,18 @@ static int ns_put_nsec_nxdomain(const knot_dname_t *qname,
if (previous == NULL) {
/*! \todo Check version. */
previous = knot_zone_contents_find_previous(zone, qname);
while (!knot_node_is_auth(previous)) {
previous = knot_node_previous(previous, 1);
}
previous = knot_node_current(previous);
assert(previous != NULL);
}
char *name = knot_dname_to_str(previous->owner);
debug_knot_ns("Previous node: %s\n", name);
free(name);
// 1) NSEC proving that there is no node with the searched name
rrset = knot_node_rrset(previous, KNOT_RRTYPE_NSEC);
......@@ -1174,9 +1183,13 @@ static void ns_put_nsec_wildcard(const knot_zone_contents_t *zone,
&& knot_query_dnssec_requested(knot_packet_query(resp)));
// check if we have previous; if not, find one using the tree
if (previous == NULL) {
if (previous == NULL) {
previous = knot_zone_contents_find_previous(zone, qname);
while (!knot_node_is_auth(previous)) {
previous = knot_node_previous(previous, 1);
}
previous = knot_node_current(previous);
assert(previous != NULL);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment