4038. [bug] Add 'rpz' flag to node and use it to determine whether
to call dns_rpz_delete. This should prevent unbalanced
add / delete calls. [RT #36888
(cherry picked from commit cc0a48a381)
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
4038. [bug] Add 'rpz' flag to node and use it to determine whether
|
||||
to call dns_rpz_delete. This should prevent unbalanced
|
||||
add / delete calls. [RT #36888]
|
||||
|
||||
4037. [bug] also-notify was ignoring the tsig key when checking
|
||||
for duplicates resulting in some expected notify
|
||||
messages not being sent. [RT #38369]
|
||||
|
||||
@@ -115,6 +115,9 @@ struct dns_rbtnode {
|
||||
unsigned int oldnamelen : 8; /*%< range is 1..255 */
|
||||
/*@}*/
|
||||
|
||||
/* node needs to be cleaned from rpz */
|
||||
unsigned int rpz : 1;
|
||||
|
||||
#ifdef DNS_RBT_USEHASH
|
||||
unsigned int hashval;
|
||||
#endif
|
||||
|
||||
@@ -1446,6 +1446,8 @@ create_node(isc_mem_t *mctx, dns_name_t *name, dns_rbtnode_t **nodep) {
|
||||
LEFT(node) = NULL;
|
||||
DOWN(node) = NULL;
|
||||
DATA(node) = NULL;
|
||||
node->rpz = 0;
|
||||
|
||||
#ifdef DNS_RBT_USEHASH
|
||||
HASHNEXT(node) = NULL;
|
||||
HASHVAL(node) = 0;
|
||||
|
||||
+6
-4
@@ -1636,7 +1636,7 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node)
|
||||
switch (node->nsec) {
|
||||
case DNS_RBT_NSEC_NORMAL:
|
||||
#ifdef BIND9
|
||||
if (rbtdb->rpz_cidr != NULL) {
|
||||
if (rbtdb->rpz_cidr != NULL && node->rpz) {
|
||||
dns_fixedname_init(&fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
dns_rbt_fullnamefromnode(node, name);
|
||||
@@ -1677,7 +1677,7 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node)
|
||||
}
|
||||
}
|
||||
#ifdef BIND9
|
||||
if (rbtdb->rpz_cidr != NULL)
|
||||
if (rbtdb->rpz_cidr != NULL && node->rpz)
|
||||
dns_rpz_cidr_deleteip(rbtdb->rpz_cidr, name);
|
||||
#endif
|
||||
result = dns_rbt_deletenode(rbtdb->tree, node, ISC_FALSE);
|
||||
@@ -2679,6 +2679,7 @@ findnodeintree(dns_rbtdb_t *rbtdb, dns_rbt_t *tree, dns_name_t *name,
|
||||
fname = dns_fixedname_name(&fnamef);
|
||||
dns_rbt_fullnamefromnode(node, fname);
|
||||
dns_rpz_cidr_addip(rbtdb->rpz_cidr, fname);
|
||||
node->rpz = 1;
|
||||
}
|
||||
#endif
|
||||
dns_rbt_namefromnode(node, &nodename);
|
||||
@@ -7099,7 +7100,6 @@ loadnode(dns_rbtdb_t *rbtdb, dns_name_t *name, dns_rbtnode_t **nodep,
|
||||
"dns_rbt_addnode(NSEC): %s",
|
||||
isc_result_totext(tmpresult),
|
||||
isc_result_totext(noderesult));
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7109,8 +7109,10 @@ loadnode(dns_rbtdb_t *rbtdb, dns_name_t *name, dns_rbtnode_t **nodep,
|
||||
|
||||
done:
|
||||
#ifdef BIND9
|
||||
if (noderesult == ISC_R_SUCCESS && rbtdb->rpz_cidr != NULL)
|
||||
if (noderesult == ISC_R_SUCCESS && rbtdb->rpz_cidr != NULL) {
|
||||
dns_rpz_cidr_addip(rbtdb->rpz_cidr, name);
|
||||
node->rpz = 1;
|
||||
}
|
||||
#endif
|
||||
if (noderesult == ISC_R_SUCCESS || noderesult == ISC_R_EXISTS)
|
||||
*nodep = node;
|
||||
|
||||
Reference in New Issue
Block a user