Commit a2cb13e3 authored by Lubos Slovak's avatar Lubos Slovak

Major review of zone-adjusting functions.

- Removed special adjusting functions in xfr-in.c.
- Modified knot_zone_contents_adjust() to do all adjusting tasks
  to ensure the zone is consistent.
  TODO: Insertion of domain names to domain table should be
        optional.

refs #1550
parent cece4351
......@@ -3227,7 +3227,7 @@ int knot_ns_process_axfrin(knot_nameserver_t *nameserver, knot_ns_xfr_t *xfr)
assert(zone != NULL);
dbg_ns("ns_process_axfrin: adjusting zone.\n");
knot_zone_contents_adjust(zone, 0);
knot_zone_contents_adjust(zone);
/* Create and fill hash table */
dbg_ns("ns_process_axfrin: filling hash table.\n");
......
This diff is collapsed.
......@@ -45,7 +45,7 @@
* Debug macros
*/
/*! \todo Set these during configure. */
#define KNOT_ZONE_DEBUG
//#define KNOT_ZONE_DEBUG
//#define KNOT_RESPONSE_DEBUG
//#define KNOT_ZONEDB_DEBUG
//#define KNOT_DNAME_DEBUG
......@@ -58,7 +58,7 @@
//#define CUCKOO_DEBUG
//#define CUCKOO_DEBUG_HASH
//#define KNOT_NS_DEBUG
//#define KNOT_XFRIN_DEBUG
#define KNOT_XFRIN_DEBUG
//#define KNOT_DDNS_DEBUG
//#define KNOT_TSIG_DEBUG
......
This diff is collapsed.
......@@ -362,7 +362,7 @@ knot_node_t *knot_zone_contents_get_apex(
*
* \param zone Zone to adjust domain names in.
*/
int knot_zone_contents_adjust(knot_zone_contents_t *contents, int check_ver);
int knot_zone_contents_adjust(knot_zone_contents_t *contents);
/*!
* \brief Parses the NSEC3PARAM record stored in the zone.
......@@ -549,11 +549,11 @@ int knot_zone_contents_shallow_copy(const knot_zone_contents_t *from,
int knot_zone_contents_shallow_copy2(const knot_zone_contents_t *from,
knot_zone_contents_t **to);
int knot_zone_contents_dnames_from_node_to_table(
knot_dname_table_t *table, knot_node_t *node);
//int knot_zone_contents_dnames_from_node_to_table(
// knot_dname_table_t *table, knot_node_t *node);
void knot_zone_contents_adjust_node(knot_node_t *node,
knot_zone_contents_t *zone, int check_ver);
//void knot_zone_contents_adjust_node(knot_node_t *node,
// knot_zone_contents_t *zone, int check_ver);
void knot_zone_contents_free(knot_zone_contents_t **contents);
......
......@@ -132,6 +132,8 @@ static int knot_zone_tree_deep_copy_node(knot_zone_tree_node_t *from,
}
int ret = knot_node_shallow_copy(from->node, &(*to)->node);
// printf("Copied node: %p to node %p. New node1: %p, new node 2: %p\n",
// from->node, (*to)->node, from->node->new_node, (*to)->node->new_node);
if (ret != KNOT_EOK) {
dbg_zone_verb("Failed to do shallow copy of node.\n");
free(*to);
......
......@@ -609,7 +609,7 @@ int zone_read(const char *name, const char *zonefile, const char *outfile,
parser->errors++;
}
knot_zone_contents_adjust(contents, 0);
knot_zone_contents_adjust(contents);
dbg_zp("rdata adjusted\n");
......
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