Commit 6827438c authored by Jan Včelák's avatar Jan Včelák 🚀

update zone_tree_apply calls to use new interface

refs #181
parent 830d7732
......@@ -174,7 +174,7 @@ void estimator_free(void *p)
free(p);
}
static void get_ahtable_size(void *t, void *d)
static int get_ahtable_size(void *t, void *d)
{
ahtable_t *table = (ahtable_t *)t;
size_t *size = (size_t *)d;
......@@ -191,6 +191,8 @@ static void get_ahtable_size(void *t, void *d)
// slots
*size += table->n * sizeof(void *);
*size += AHTABLE_ADD;
return KNOT_EOK;
}
size_t estimator_trie_ahtable_memsize(hattrie_t *table)
......@@ -210,10 +212,12 @@ void estimator_rrset_memsize_wrap(const scanner_t *scanner)
rrset_memsize(scanner->data, scanner);
}
void estimator_free_trie_node(value_t *val, void *data)
int estimator_free_trie_node(value_t *val, void *data)
{
UNUSED(data);
dummy_node_t *trie_n = (dummy_node_t *)(*val);
WALK_LIST_FREE(trie_n->node_list);
free(trie_n);
return KNOT_EOK;
}
......@@ -83,7 +83,7 @@ void estimator_rrset_memsize_wrap(const scanner_t *scanner);
*
* \param p Data to free.
*/
void estimator_free_trie_node(value_t *val, void *data);
int estimator_free_trie_node(value_t *val, void *data);
#endif /* _KNOT_ESTIMATOR_H_ */
......
......@@ -776,10 +776,12 @@ struct sem_check_param {
* \param node Node to be counted
* \param data Count casted to void *
*/
static void count_nodes_in_tree(knot_node_t *node, void *data)
static int count_nodes_in_tree(knot_node_t *node, void *data)
{
struct sem_check_param *param = (struct sem_check_param *)data;
param->node_count++;
return KNOT_EOK;
}
static int zone_is_secure(const knot_zone_contents_t *z)
......@@ -1121,7 +1123,7 @@ static int semantic_checks_dnssec(knot_zone_contents_t *zone,
* \param node Node to be searched.
* \param data Arguments.
*/
static void do_checks_in_tree(knot_node_t *node, void *data)
static int do_checks_in_tree(knot_node_t *node, void *data)
{
dbg_semcheck_verb("semcheck: do_check_in_tree: Checking node: %s\n",
knot_dname_to_str(node->owner));
......@@ -1154,7 +1156,7 @@ static void do_checks_in_tree(knot_node_t *node, void *data)
sem_check_node_plain(zone, node, check_level, handler, 1,
(int *)args->arg7);
free(rrsets);
return;
return KNOT_EOK;
}
if (do_checks > 1) {
......@@ -1163,6 +1165,7 @@ static void do_checks_in_tree(knot_node_t *node, void *data)
}
free(rrsets);
return KNOT_EOK;
}
int zone_do_sem_checks(knot_zone_contents_t *zone, int do_checks,
......
......@@ -28,7 +28,6 @@
/*! \brief Dump parameters. */
typedef struct {
int ret;
FILE *file;
char *buf;
size_t buflen;
......@@ -37,15 +36,14 @@ typedef struct {
const knot_dump_style_t *style;
} dump_params_t;
static void apex_node_dump_text(knot_node_t *node, dump_params_t *params)
static int apex_node_dump_text(knot_node_t *node, dump_params_t *params)
{
knot_rrset_t *rr = knot_node_get_rrset(node, KNOT_RRTYPE_SOA);
// Dump SOA record as a first.
if (knot_rrset_txt_dump(rr, params->buf, params->buflen,
params->style) < 0) {
params->ret = KNOT_ENOMEM;
return;
return KNOT_ENOMEM;
}
params->rr_count += rr->rdata_count;
if (rr->rrsigs != NULL) {
......@@ -61,9 +59,8 @@ static void apex_node_dump_text(knot_node_t *node, dump_params_t *params)
if (knot_rrset_txt_dump(rrsets[i], params->buf,
params->buflen, params->style)
< 0) {
params->ret = KNOT_ENOMEM;
free(rrsets);
return;
return KNOT_ENOMEM;
}
params->rr_count += rrsets[i]->rdata_count;
if (rrsets[i]->rrsigs != NULL) {
......@@ -76,17 +73,17 @@ static void apex_node_dump_text(knot_node_t *node, dump_params_t *params)
free(rrsets);
params->ret = KNOT_EOK;
return KNOT_EOK;
}
static void node_dump_text(knot_node_t *node, void *data)
static int node_dump_text(knot_node_t *node, void *data)
{
dump_params_t *params = (dump_params_t *)data;
// Zone apex rrsets.
if (node->owner == params->origin) {
apex_node_dump_text(node, params);
return;
return KNOT_EOK;
}
const knot_rrset_t **rrsets = knot_node_rrsets(node);
......@@ -95,9 +92,8 @@ static void node_dump_text(knot_node_t *node, void *data)
for (uint16_t i = 0; i < node->rrset_count; i++) {
if (knot_rrset_txt_dump(rrsets[i], params->buf, params->buflen,
params->style) < 0) {
params->ret = KNOT_ENOMEM;
free(rrsets);
return;
return KNOT_ENOMEM;
}
params->rr_count += rrsets[i]->rdata_count;
if (rrsets[i]->rrsigs != NULL) {
......@@ -108,7 +104,7 @@ static void node_dump_text(knot_node_t *node, void *data)
free(rrsets);
params->ret = KNOT_EOK;
return KNOT_EOK;
}
int zone_dump_text(knot_zone_contents_t *zone, FILE *file)
......@@ -128,7 +124,6 @@ int zone_dump_text(knot_zone_contents_t *zone, FILE *file)
// Set structure with parameters.
dump_params_t params;
params.ret = KNOT_ERROR;
params.file = file;
params.buf = buf;
params.buflen = DUMP_BUF_LEN;
......@@ -136,16 +131,18 @@ int zone_dump_text(knot_zone_contents_t *zone, FILE *file)
params.origin = knot_node_owner(knot_zone_contents_apex(zone));
params.style = &KNOT_DUMP_STYLE_DEFAULT;
int ret;
// Dump standard zone records.
knot_zone_contents_tree_apply_inorder(zone, node_dump_text, &params);
if (params.ret != KNOT_EOK) {
return params.ret;
ret = knot_zone_contents_tree_apply_inorder(zone, node_dump_text, &params);
if (ret != KNOT_EOK) {
return ret;
}
// Dump NSEC3 zone records.
knot_zone_contents_nsec3_apply_inorder(zone, node_dump_text, &params);
if (params.ret != KNOT_EOK) {
return params.ret;
ret = knot_zone_contents_nsec3_apply_inorder(zone, node_dump_text, &params);
if (ret != KNOT_EOK) {
return ret;
}
// Create formated date-time string.
......
......@@ -467,7 +467,6 @@ typedef struct node_sign_args {
const knot_dnssec_policy_t *policy;
knot_changeset_t *changeset;
uint32_t expires_at;
int result;
} node_sign_args_t;
/*!
......@@ -476,27 +475,26 @@ typedef struct node_sign_args {
* \param node Node to be signed.
* \param data Callback data, node_sign_args_t.
*/
static void sign_node(knot_node_t **node, void *data)
static int sign_node(knot_node_t **node, void *data)
{
assert(node && *node);
node_sign_args_t *args = (node_sign_args_t *)data;
assert(data);
if (args->result != KNOT_EOK) {
return;
}
node_sign_args_t *args = (node_sign_args_t *)data;
if ((*node)->rrset_count == 0) {
return;
return KNOT_EOK;
}
if (knot_node_is_non_auth(*node)) {
return;
return KNOT_EOK;
}
args->result = sign_node_rrsets(*node, args->zone_keys, args->policy,
args->changeset, &args->expires_at);
int result = sign_node_rrsets(*node, args->zone_keys, args->policy,
args->changeset, &args->expires_at);
knot_node_clear_replaced_nsec(*node);
return result;
}
/*!
......@@ -525,12 +523,13 @@ static int zone_tree_sign(knot_zone_tree_t *tree,
.zone_keys = zone_keys,
.policy = policy,
.changeset = changeset,
.result = KNOT_EOK,
.expires_at = time(NULL) + policy->sign_lifetime
};
knot_zone_tree_apply(tree, sign_node, &args);
return args.result;
int result = knot_zone_tree_apply(tree, sign_node, &args);
*expires_at = args.expires_at;
return result;
}
/*- private API - signing of NSEC(3) in changeset ----------------------------*/
......
......@@ -2495,13 +2495,6 @@ static int ns_error_response_to_wire(knot_packet_t *resp, uint8_t *wire,
/*----------------------------------------------------------------------------*/
typedef struct ns_axfr_params {
knot_ns_xfr_t *xfr;
int ret;
} ns_axfr_params_t;
/*----------------------------------------------------------------------------*/
int knot_ns_tsig_required(int packet_nr)
{
/*! \bug This can overflow to negative numbers. Proper solution is to
......@@ -2642,19 +2635,12 @@ dbg_ns_exec_verb(
/*----------------------------------------------------------------------------*/
static void ns_axfr_from_node(knot_node_t *node, void *data)
static int ns_axfr_from_node(knot_node_t *node, void *data)
{
assert(node != NULL);
assert(data != NULL);
ns_axfr_params_t *params = (ns_axfr_params_t *)data;
if (params->ret != KNOT_EOK) {
// just skip (will be called on next node with the same params
dbg_ns_detail("Params contain error: %s, skipping node...\n",
knot_strerror(params->ret));
return;
}
knot_ns_xfr_t *xfr = (knot_ns_xfr_t *)data;
dbg_ns_detail("Params OK, answering AXFR from node %p.\n", node);
dbg_ns_exec_verb(
......@@ -2664,17 +2650,16 @@ dbg_ns_exec_verb(
);
if (knot_node_rrset_count(node) == 0) {
return;
return KNOT_EOK;
}
knot_rrset_t **rrsets = knot_node_get_rrsets(node);
if (rrsets == NULL) {
params->ret = KNOT_ENOMEM;
return;
return KNOT_ENOMEM;
}
int i = 0;
int ret = 0;
int ret = KNOT_EOK;
knot_rrset_t *rrset = NULL;
while (i < knot_node_rrset_count(node)) {
assert(rrsets[i] != NULL);
......@@ -2695,24 +2680,24 @@ rrset:
goto rrsigs;
}
ret = knot_response_add_rrset_answer(
params->xfr->response, rrset, 0, 0, 0);
ret = knot_response_add_rrset_answer(xfr->response, rrset,
0, 0, 0);
if (ret == KNOT_ESPACE) {
// TODO: send the packet and clean the structure
dbg_ns("Packet full, sending..\n");
ret = ns_xfr_send_and_clear(params->xfr,
knot_ns_tsig_required(params->xfr->packet_nr));
ret = ns_xfr_send_and_clear(xfr,
knot_ns_tsig_required(xfr->packet_nr));
if (ret != KNOT_EOK) {
// some wierd problem, we should end
params->ret = KNOT_ERROR;
ret = KNOT_ERROR;
break;
}
// otherwise try once more with the same RRSet
goto rrset;
} else if (ret != KNOT_EOK) {
// some wierd problem, we should end
params->ret = KNOT_ERROR;
ret = KNOT_ERROR;
break;
}
......@@ -2724,24 +2709,24 @@ rrsigs:
continue;
}
ret = knot_response_add_rrset_answer(params->xfr->response,
rrset, 0, 0, 0);
ret = knot_response_add_rrset_answer(xfr->response, rrset,
0, 0, 0);
if (ret == KNOT_ESPACE) {
// TODO: send the packet and clean the structure
dbg_ns("Packet full, sending..\n");
ret = ns_xfr_send_and_clear(params->xfr,
knot_ns_tsig_required(params->xfr->packet_nr));
ret = ns_xfr_send_and_clear(xfr,
knot_ns_tsig_required(xfr->packet_nr));
if (ret != KNOT_EOK) {
// some wierd problem, we should end
params->ret = KNOT_ERROR;
ret = KNOT_ERROR;
break;
}
// otherwise try once more with the same RRSet
goto rrsigs;
} else if (ret != KNOT_EOK) {
// some wierd problem, we should end
params->ret = KNOT_ERROR;
ret = KNOT_ERROR;
break;
}
......@@ -2754,6 +2739,7 @@ rrsigs:
/*! \todo maybe distinguish some error codes. */
//params->ret = (ret == 0) ? KNOT_EOK : KNOT_ERROR;
return ret;
}
/*----------------------------------------------------------------------------*/
......@@ -2766,11 +2752,6 @@ static int ns_axfr_from_zone(knot_zone_contents_t *zone, knot_ns_xfr_t *xfr)
assert(xfr->wire != NULL);
assert(xfr->send != NULL);
ns_axfr_params_t params;
memset(&params, 0, sizeof(ns_axfr_params_t));
params.xfr = xfr;
params.ret = KNOT_EOK;
xfr->packet_nr = 0;
/*
......@@ -2803,17 +2784,13 @@ static int ns_axfr_from_zone(knot_zone_contents_t *zone, knot_ns_xfr_t *xfr)
return KNOT_ERROR;
}
knot_zone_contents_tree_apply_inorder(zone, ns_axfr_from_node,
&params);
if (params.ret != KNOT_EOK) {
ret = knot_zone_contents_tree_apply_inorder(zone, ns_axfr_from_node, &xfr);
if (ret != KNOT_EOK) {
return KNOT_ERROR; // maybe do something with the code
}
knot_zone_contents_nsec3_apply_inorder(zone, ns_axfr_from_node,
&params);
if (params.ret != KNOT_EOK) {
ret = knot_zone_contents_nsec3_apply_inorder(zone, ns_axfr_from_node, &xfr);
if (ret != KNOT_EOK) {
return KNOT_ERROR; // maybe do something with the code
}
......
......@@ -2214,7 +2214,7 @@ void xfrin_cleanup_successful_update(knot_changes_t *changes)
/* New changeset applying */
/*----------------------------------------------------------------------------*/
static void xfrin_switch_nodes_in_node(knot_node_t *node, void *data)
static int xfrin_switch_nodes_in_node(knot_node_t *node, void *data)
{
assert(node != NULL);
UNUSED(data);
......@@ -2222,6 +2222,8 @@ static void xfrin_switch_nodes_in_node(knot_node_t *node, void *data)
assert(knot_node_new_node(node) == NULL);
knot_node_update_refs(node);
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
......@@ -2261,12 +2263,14 @@ static void xfrin_zone_contents_free2(knot_zone_contents_t **contents)
/*----------------------------------------------------------------------------*/
static void xfrin_cleanup_old_nodes(knot_node_t *node, void *data)
static int xfrin_cleanup_old_nodes(knot_node_t *node, void *data)
{
UNUSED(data);
assert(node != NULL);
knot_node_set_new_node(node, NULL);
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
......@@ -2636,16 +2640,20 @@ static void xfrin_mark_empty_node(knot_node_t *node, knot_changes_t *changes,
/*----------------------------------------------------------------------------*/
static void xfrin_mark_empty_nsec3(knot_node_t *node, void *data)
static int xfrin_mark_empty_nsec3(knot_node_t *node, void *data)
{
xfrin_mark_empty_node(node,
(knot_changes_t *)data, KNOT_CHANGES_NSEC3_NODE);
return KNOT_EOK;
}
static void xfrin_mark_empty(knot_node_t *node, void *data)
static int xfrin_mark_empty(knot_node_t *node, void *data)
{
xfrin_mark_empty_node(node,
(knot_changes_t *)data, KNOT_CHANGES_NORMAL_NODE);
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
......@@ -2727,19 +2735,14 @@ dbg_xfrin_exec_detail(
/*----------------------------------------------------------------------------*/
static void xfrin_check_contents_copy_node(knot_node_t *node, void *data)
static int xfrin_check_contents_copy_node(knot_node_t *node, void *data)
{
assert(node != NULL);
assert(data != NULL);
int *err = (int *)data;
if (*err != KNOT_EOK) {
return;
}
if (knot_node_new_node(node) == NULL) {
*err = KNOT_ENONODE;
return KNOT_ENONODE;
} else {
return KNOT_EOK;
}
}
......@@ -2747,27 +2750,21 @@ static void xfrin_check_contents_copy_node(knot_node_t *node, void *data)
static int xfrin_check_contents_copy(knot_zone_contents_t *old_contents)
{
int err = KNOT_EOK;
int ret = knot_zone_contents_tree_apply_inorder(old_contents,
xfrin_check_contents_copy_node,
&err);
NULL);
assert(ret == KNOT_EOK);
if (err == KNOT_EOK) {
if (ret == KNOT_EOK) {
ret = knot_zone_contents_nsec3_apply_inorder(old_contents,
xfrin_check_contents_copy_node,
&err);
NULL);
}
assert(ret == KNOT_EOK);
if (knot_node_new_node(knot_zone_contents_apex(old_contents)) == NULL) {
return KNOT_ENONODE;
}
return err;
return ret;
}
/*----------------------------------------------------------------------------*/
......
This diff is collapsed.
......@@ -75,6 +75,11 @@ typedef struct cname_chain {
struct cname_chain *next;
} cname_chain_t;
/*!
* \brief Signature of callback for zone contents apply functions.
*/
typedef int (*knot_zone_contents_apply_cb_t)(knot_node_t *node, void *data);
/*----------------------------------------------------------------------------*/
knot_zone_contents_t *knot_zone_contents_new(knot_node_t *apex,
......@@ -397,9 +402,9 @@ const knot_nsec3_params_t *knot_zone_contents_nsec3params(
* \param function Function to be applied to each node of the zone.
* \param data Arbitrary data to be passed to the function.
*/
int knot_zone_contents_tree_apply_inorder(knot_zone_contents_t *contents,
void (*function)(knot_node_t *node, void *data),
void *data);
int knot_zone_contents_tree_apply_inorder(knot_zone_contents_t *zone,
knot_zone_contents_apply_cb_t function,
void *data);
/*!
* \brief Applies the given function to each regular node in the zone.
......@@ -415,9 +420,9 @@ int knot_zone_contents_tree_apply_inorder(knot_zone_contents_t *contents,
* \param function Function to be applied to each node of the zone.
* \param data Arbitrary data to be passed to the function.
*/
int knot_zone_contents_tree_apply_inorder_reverse(
knot_zone_contents_t *contents,
void (*function)(knot_node_t *node, void *data), void *data);
int knot_zone_contents_tree_apply_inorder_reverse(knot_zone_contents_t *zone,
knot_zone_contents_apply_cb_t function,
void *data);
/*!
* \brief Applies the given function to each NSEC3 node in the zone.
......@@ -434,9 +439,9 @@ int knot_zone_contents_tree_apply_inorder_reverse(
* \param function Function to be applied to each node of the zone.
* \param data Arbitrary data to be passed to the function.
*/
int knot_zone_contents_nsec3_apply_inorder(knot_zone_contents_t *contents,
void (*function)(knot_node_t *node, void *data),
void *data);
int knot_zone_contents_nsec3_apply_inorder(knot_zone_contents_t *zone,
knot_zone_contents_apply_cb_t function,
void *data);
/*!
* \brief Applies the given function to each NSEC3 node in the zone.
......@@ -453,9 +458,9 @@ int knot_zone_contents_nsec3_apply_inorder(knot_zone_contents_t *contents,
* \param function Function to be applied to each node of the zone.
* \param data Arbitrary data to be passed to the function.
*/
int knot_zone_contents_nsec3_apply_inorder_reverse(
knot_zone_contents_t *contents,
void (*function)(knot_node_t *node, void *data), void *data);
int knot_zone_contents_nsec3_apply_inorder_reverse(knot_zone_contents_t *zone,
knot_zone_contents_apply_cb_t function,
void *data);
knot_zone_tree_t *knot_zone_contents_get_nodes(
knot_zone_contents_t *contents);
......@@ -463,11 +468,6 @@ knot_zone_tree_t *knot_zone_contents_get_nodes(
knot_zone_tree_t *knot_zone_contents_get_nsec3_nodes(
knot_zone_contents_t *contents);
int knot_zone_contents_dname_table_apply(knot_zone_contents_t *contents,
void (*function)(knot_dname_t *,
void *),
void *data);
/*!
* \brief Creates a shallow copy of the zone (no stored data are copied).
*
......
......@@ -29,7 +29,6 @@
struct zone_diff_param {
knot_zone_tree_t *nodes;
knot_changeset_t *changeset;
int ret;
};
// forward declaration
......@@ -590,11 +589,11 @@ static int knot_zone_diff_rrsets(const knot_rrset_t *rrset1,
}
/*!< \todo this could be generic function for adding / removing. */
static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
static int knot_zone_diff_node(knot_node_t **node_ptr, void *data)
{
if (node_ptr == NULL || *node_ptr == NULL || data == NULL) {
dbg_zonediff("zone_diff: diff_node: NULL arguments.\n");
return;
return KNOT_EINVAL;
}
knot_node_t *node = *node_ptr;
......@@ -602,15 +601,7 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
struct zone_diff_param *param = (struct zone_diff_param *)data;
if (param->changeset == NULL || param->nodes == NULL) {
dbg_zonediff("zone_diff: diff_node: NULL arguments.\n");
param->ret = KNOT_EINVAL;
return;
}
if (param->ret != KNOT_EOK) {
/* Error occured before, no point in continuing. */
dbg_zonediff_detail("zone_diff: diff_node: error: %s\n",
knot_strerror(param->ret));
return;
return KNOT_EINVAL;
}
/*
......@@ -631,11 +622,8 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
node);
if (ret != KNOT_EOK) {
dbg_zonediff("zone_diff: failed to remove node.\n");
param->ret = ret;
return;
}
param->ret = KNOT_EOK;
return;
return ret;
}
assert(node_in_second_tree != node);
......@@ -657,8 +645,7 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
"Could not add node from second tree. "
"Reason: %s.\n", knot_strerror(ret));
}
param->ret = ret;
return;
return ret;
}
for (uint i = 0; i < knot_node_rrset_count(node); i++) {
......@@ -686,9 +673,8 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
if (ret != KNOT_EOK) {
dbg_zonediff("zone_diff: diff_node: "
"Failed to remove RRSet.\n");
param->ret = ret;
free(rrsets);
return;
return ret;
}
/* Remove RRSet's RRSIGs as well. */
......@@ -699,9 +685,8 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
if (ret != KNOT_EOK) {
dbg_zonediff("zone_diff: diff_node+: "
"Failed to remove RRSIGs.\n");
param->ret = ret;
free(rrsets);
return;
return ret;
}
}
} else {
......@@ -715,9 +700,8 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
if (ret != KNOT_EOK) {
dbg_zonediff("zone_diff: "
"Failed to diff RRSets.\n");
param->ret = ret;
free(rrsets);
return;
return ret;
}
// dbg_zonediff_verb("zone_diff: diff_node: Changes in "
......@@ -729,8 +713,7 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
// if (ret != KNOT_EOK) {
// dbg_zonediff("zone_diff: "
// "Failed to diff RRSIGs.\n");
// param->ret = ret;
// return;
// return ret;
// }
}
}
......@@ -755,8 +738,7 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
// "Cannot remove node. Reason: %s.\n",
// knot_strerror(ret));
// }
param->ret = KNOT_EOK;
return;
return KNOT_EOK;
}
for (uint i = 0; i < knot_node_rrset_count(node_in_second_tree); i++) {
......@@ -784,9 +766,8 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
if (ret != KNOT_EOK) {
dbg_zonediff("zone_diff: diff_node: "
"Failed to add RRSet.\n");
param->ret = ret;
free(rrsets);
return;
return ret;
}
if (knot_rrset_rrsigs(rrset)) {
int ret = knot_zone_diff_changeset_add_rrset(
......@@ -795,9 +776,8 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
if (ret != KNOT_EOK) {
dbg_zonediff("zone_diff: diff_node: "
"Failed to add RRSIGs.\n");
param->ret = ret;
free(rrsets);
return;
return ret;
}
}
} else {
......@@ -808,15 +788,15 @@ static void knot_zone_diff_node(knot_node_t **node_ptr, void *data)
free(rrsets);
assert(param->ret == KNOT_EOK);
return KNOT_EOK;
}
/*!< \todo possibly not needed! */
static void knot_zone_diff_add_new_nodes(knot_node_t **node_ptr, void *data)
static int knot_zone_diff_add_new_nodes(knot_node_t **node_ptr, void *data)
{
if (node_ptr == NULL || *node_ptr == NULL || data == NULL) {
dbg_zonediff("zone_diff: add_new_nodes: NULL arguments.\n");