Skip to content
Snippets Groups Projects
Commit 21f6481f authored by Libor Peltan's avatar Libor Peltan Committed by Daniel Salzman
Browse files

bugfix: update NSEC3 hashes before updating additionals_tree

parent 37256fe7
No related branches found
No related tags found
No related merge requests found
/* Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -281,6 +281,15 @@ int adjust_cb_nsec3_and_additionals(zone_node_t *node, adjust_ctx_t *ctx)
return ret;
}
int adjust_cb_nsec3_and_wildcard(zone_node_t *node, adjust_ctx_t *ctx)
{
int ret = adjust_cb_wildcard_nsec3(node, ctx);
if (ret == KNOT_EOK) {
ret = adjust_cb_nsec3_pointer(node, ctx);
}
return ret;
}
int adjust_cb_void(zone_node_t *node, adjust_ctx_t *ctx)
{
UNUSED(node);
......@@ -544,7 +553,7 @@ int zone_adjust_incremental_update(zone_update_t *update, unsigned threads)
false, true, 1, update->a_ctx->adjust_ptrs);
if (ret == KNOT_EOK) {
if (nsec3change) {
ret = zone_adjust_contents(update->new_cont, adjust_cb_wildcard_nsec3, NULL,
ret = zone_adjust_contents(update->new_cont, adjust_cb_nsec3_and_wildcard, NULL,
false, false, threads, update->a_ctx->adjust_ptrs);
if (ret == KNOT_EOK) {
// just measure zone size
......@@ -577,10 +586,7 @@ int zone_adjust_incremental_update(zone_update_t *update, unsigned threads)
ret = zone_adjust_update(update, adjust_cb_additionals, adjust_cb_void, false);
}
if (ret == KNOT_EOK) {
if (nsec3change) {
ret = zone_adjust_contents(update->new_cont, adjust_cb_nsec3_pointer, adjust_cb_void,
false, false, threads, update->a_ctx->adjust_ptrs);
} else {
if (!nsec3change) {
ret = additionals_reverse_apply_multi(
update->new_cont->adds_tree,
update->a_ctx->nsec3_ptrs,
......
/* Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -60,6 +60,9 @@ int adjust_cb_flags_and_nsec3(zone_node_t *node, adjust_ctx_t *ctx);
// adjust_cb_nsec3_pointer, adjust_cb_wildcard_nsec3 and adjust_cb_additionals at once
int adjust_cb_nsec3_and_additionals(zone_node_t *node, adjust_ctx_t *ctx);
// adjust_cb_wildcard_nsec3 and adjust_cb_nsec3_pointer at once
int adjust_cb_nsec3_and_wildcard(zone_node_t *node, adjust_ctx_t *ctx);
// dummy callback, just make prev pointers adjusting and zone size measuring work
int adjust_cb_void(zone_node_t *node, adjust_ctx_t *ctx);
......
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