Adjust RPZ trigger counts only when the entry being deleted exists (#43386)

(cherry picked from commit f23c10f925)
This commit is contained in:
Mukund Sivaraman 2017-04-21 17:13:45 +05:30
parent eeb16584fb
commit 9a8b2b3ab3
3 changed files with 25 additions and 1 deletions

View file

@ -1,3 +1,6 @@
4600. [bug] Adjust RPZ trigger counts only when the entry
being deleted exists. [RT #43386]
4599. [bug] Fix inconsistencies in inline signing time
comparison that were introduced with the
introduction of rdatasetheader->resign_lsb.

View file

@ -1948,7 +1948,13 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
name = dns_fixedname_name(&fname);
dns_rbt_fullnamefromnode(node, name);
/*
* dns_rbt_deletenode() may keep the node if it has a
* down pointer, but we mustn't call dns_rpz_delete() on
* it again.
*/
node_has_rpz = node->rpz;
node->rpz = 0;
result = dns_rbt_deletenode(rbtdb->tree, node, ISC_FALSE);
if (result == ISC_R_SUCCESS &&
rbtdb->rpzs != NULL && node_has_rpz)
@ -1985,7 +1991,13 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
isc_result_totext(result));
}
}
/*
* dns_rbt_deletenode() may keep the node if it has a
* down pointer, but we mustn't call dns_rpz_delete() on
* it again.
*/
node_has_rpz = node->rpz;
node->rpz = 0;
result = dns_rbt_deletenode(rbtdb->tree, node, ISC_FALSE);
if (result == ISC_R_SUCCESS &&
rbtdb->rpzs != NULL && node_has_rpz)
@ -7196,8 +7208,12 @@ loadnode(dns_rbtdb_t *rbtdb, dns_name_t *name, dns_rbtnode_t **nodep,
/*
* Remove the node we just added above.
* dns_rbt_deletenode() may keep the node if it has a
* down pointer, but we mustn't call dns_rpz_delete() on
* it again.
*/
node_has_rpz = node->rpz;
node->rpz = 0;
tmpresult = dns_rbt_deletenode(rbtdb->tree, node, ISC_FALSE);
if (tmpresult == ISC_R_SUCCESS) {
/*

View file

@ -2017,6 +2017,7 @@ del_name(dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
dns_rbtnode_t *nmnode;
dns_rpz_nm_data_t *nm_data, del_data;
isc_result_t result;
isc_boolean_t exists;
/*
* We need a summary database of names even with 1 policy zone,
@ -2060,6 +2061,9 @@ del_name(dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
del_data.wild.qname &= nm_data->wild.qname;
del_data.wild.ns &= nm_data->wild.ns;
exists = ISC_TF(del_data.set.qname != 0 || del_data.set.ns != 0 ||
del_data.wild.qname != 0 || del_data.wild.ns != 0);
nm_data->set.qname &= ~del_data.set.qname;
nm_data->set.ns &= ~del_data.set.ns;
nm_data->wild.qname &= ~del_data.wild.qname;
@ -2080,7 +2084,8 @@ del_name(dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
}
}
adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, ISC_FALSE);
if (exists)
adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, ISC_FALSE);
}
/*