* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acl.c,v 1.37.2.5 2008/01/22 05:39:18 each Exp $ */
+/* $Id: acl.c,v 1.37.2.6 2008/01/27 02:12:51 marka Exp $ */
/*! \file */
/* Found a match. */
if (result == ISC_R_SUCCESS && node != NULL) {
+ if (node->bit == 0)
+ family = AF_INET;
match_num = node->node_num[ISC_IS6(family)];
if (*(isc_boolean_t *) node->data[ISC_IS6(family)] == ISC_TRUE)
*match = match_num;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: radix.c,v 1.9.6.2 2008/01/21 23:46:23 tbox Exp $ */
+/* $Id: radix.c,v 1.9.6.3 2008/01/27 02:12:51 marka Exp $ */
/*
* This source was adapted from MRT's RCS Ids:
isc_radix_node_t *node;
isc_radix_node_t *stack[RADIX_MAXBITS + 1];
u_char *addr;
- isc_uint32_t bitlen, family;
+ isc_uint32_t bitlen, family, tfamily = -1;
int cnt = 0;
REQUIRE(radix != NULL);
addr = isc_prefix_touchar(prefix);
bitlen = prefix->bitlen;
- /* Bitlen 0 means "any" or "none", which is always treated as IPv4 */
- family = bitlen ? prefix->family : AF_INET;
while (node->bit < bitlen) {
if (node->prefix)
if (_comp_with_mask(isc_prefix_tochar(node->prefix),
isc_prefix_tochar(prefix),
node->prefix->bitlen)) {
+ /* Bitlen 0 means "any" or "none",
+ which is always treated as IPv4 */
+ family = node->prefix->bitlen ?
+ prefix->family : AF_INET;
if (node->node_num[ISC_IS6(family)] != -1 &&
- ((*target == NULL) ||
- (*target)->node_num[ISC_IS6(family)] >
- node->node_num[ISC_IS6(family)]))
+ ((*target == NULL) ||
+ (*target)->node_num[ISC_IS6(tfamily)] >
+ node->node_num[ISC_IS6(family)])) {
*target = node;
+ tfamily = family;
+ }
}
}