2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

improve readability of radix code

- use RADIX_V4 and RADIX_V6 instead of 0 and 1 as array indices
- remove some unused macros
This commit is contained in:
Evan Hunt
2018-05-25 13:25:54 -07:00
parent e7b2b097ed
commit 3006ccb7f0
4 changed files with 50 additions and 67 deletions

View File

@@ -219,12 +219,13 @@ dns_acl_match(const isc_netaddr_t *reqaddr,
/* Found a match. */
if (result == ISC_R_SUCCESS && node != NULL) {
int off = ISC_RADIX_OFF(&pfx);
match_num = node->node_num[off];
if (*(isc_boolean_t *) node->data[off])
int fam = ISC_RADIX_FAMILY(&pfx);
match_num = node->node_num[fam];
if (*(isc_boolean_t *) node->data[fam]) {
*match = match_num;
else
} else {
*match = -match_num;
}
}
isc_refcount_destroy(&pfx.refcount);