Commit 9d2939ca authored by Vitezslav Kriz's avatar Vitezslav Kriz Committed by Jan Včelák

semcheck: refactor zone_contents_adjust

parent c242a1ca
......@@ -318,7 +318,7 @@ static int axfr_answer_finalize(struct answer_data *adata)
* marked authoritative / delegation point.
*/
struct xfr_proc *proc = adata->ext;
int rc = zone_contents_adjust_full(proc->contents, NULL, NULL);
int rc = zone_contents_adjust_full(proc->contents);
if (rc != KNOT_EOK) {
return rc;
}
......
......@@ -371,7 +371,7 @@ static int finalize_updated_zone(zone_contents_t *contents_copy,
}
if (set_nsec3_names) {
return zone_contents_adjust_full(contents_copy, NULL, NULL);
return zone_contents_adjust_full(contents_copy);
} else {
return zone_contents_adjust_pointers(contents_copy);
}
......
......@@ -920,9 +920,7 @@ int zone_contents_adjust_pointers(zone_contents_t *contents)
return adjust_nodes(contents->nodes, &adjust_arg, adjust_additional);
}
int zone_contents_adjust_full(zone_contents_t *zone,
zone_node_t **first_nsec3_node,
zone_node_t **last_nsec3_node)
int zone_contents_adjust_full(zone_contents_t *zone)
{
if (zone == NULL) {
return KNOT_EINVAL;
......@@ -946,14 +944,6 @@ int zone_contents_adjust_full(zone_contents_t *zone,
return result;
}
// optional output for NSEC3 nodes
if (first_nsec3_node) {
*first_nsec3_node = adjust_arg.first_node;
}
if (last_nsec3_node) {
*last_nsec3_node = adjust_arg.previous_node;
}
// adjust normal nodes
result = adjust_nodes(zone->nodes, &adjust_arg, adjust_normal_node);
if (result != KNOT_EOK) {
......
......@@ -184,9 +184,7 @@ int zone_contents_adjust_pointers(zone_contents_t *contents);
* Will not be saved if set to NULL.
* \param zone Zone to adjust domain names in.
*/
int zone_contents_adjust_full(zone_contents_t *contents,
zone_node_t **first_nsec3_node,
zone_node_t **last_nsec3_node);
int zone_contents_adjust_full(zone_contents_t *contents);
/*!
* \brief Parses the NSEC3PARAM record stored in the zone.
......
......@@ -262,7 +262,7 @@ zone_contents_t *zonefile_load(zloader_t *loader)
goto fail;
}
ret = zone_contents_adjust_full(zc->z, NULL, NULL);
ret = zone_contents_adjust_full(zc->z);
if (ret != KNOT_EOK) {
ERROR(zname, "failed to finalize zone contents (%s)",
knot_strerror(ret));
......
......@@ -50,8 +50,7 @@ static inline void create_root_zone(server_t *server, knot_mm_t *mm)
knot_rrset_free(&soa, mm);
/* Bake the zone. */
zone_node_t *first_nsec3 = NULL, *last_nsec3 = NULL;
zone_contents_adjust_full(root->contents, &first_nsec3, &last_nsec3);
zone_contents_adjust_full(root->contents);
/* Switch zone db. */
knot_zonedb_free(&server->zone_db);
......
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