mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-02 21:40:43 -05:00
Remove nodechain from dns_rbt_addnode() (#41246)
(cherry picked from commit9267cc8e83) (cherry picked from commit6f3e21cd9b)
This commit is contained in:
parent
80eff380a8
commit
6ba259b626
1 changed files with 8 additions and 7 deletions
|
|
@ -397,7 +397,7 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
|
|||
dns_offsets_t current_offsets;
|
||||
dns_namereln_t compared;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
dns_rbtnodechain_t chain;
|
||||
unsigned int level_count;
|
||||
unsigned int common_labels;
|
||||
unsigned int nlabels, hlabels;
|
||||
int order;
|
||||
|
|
@ -460,7 +460,7 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
|
|||
return (result);
|
||||
}
|
||||
|
||||
dns_rbtnodechain_init(&chain, rbt->mctx);
|
||||
level_count = 0;
|
||||
|
||||
dns_fixedname_init(&fixedprefix);
|
||||
dns_fixedname_init(&fixedsuffix);
|
||||
|
|
@ -539,8 +539,9 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
|
|||
|
||||
parent = NULL;
|
||||
child = DOWN(current);
|
||||
ADD_LEVEL(&chain, current);
|
||||
|
||||
INSIST(level_count < DNS_RBT_LEVELBLOCK);
|
||||
level_count++;
|
||||
} else {
|
||||
/*
|
||||
* The number of labels in common is fewer
|
||||
|
|
@ -567,9 +568,7 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
|
|||
* a simple integer variable, but I am pressed
|
||||
* for time.
|
||||
*/
|
||||
if (chain.level_count ==
|
||||
(sizeof(chain.levels) /
|
||||
sizeof(*chain.levels))) {
|
||||
if (level_count >= DNS_RBT_LEVELBLOCK) {
|
||||
result = ISC_R_NOSPACE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -636,7 +635,9 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
|
|||
UPPERNODE(new_current) = UPPERNODE(current);
|
||||
UPPERNODE(current) = new_current;
|
||||
#endif /* DNS_RBT_USEHASH */
|
||||
ADD_LEVEL(&chain, new_current);
|
||||
|
||||
INSIST(level_count < DNS_RBT_LEVELBLOCK);
|
||||
level_count++;
|
||||
|
||||
LEFT(current) = NULL;
|
||||
RIGHT(current) = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue