/* Get node with specified destination prefix (and source prefix, if subtrees are used)  */
static struct fib6_node* fib6_locate_1(struct fib6_node *root, struct in6_addr *addr, int plen, int offset)
/* Get node with specified destination prefix (and source prefix, if subtrees are used)  */
static struct fib6_node* fib6_locate_1(struct fib6_node *root, struct in6_addr *addr, int plen, int offset)
{
	struct fib6_node *fn;
	for (fn = root; fn ; ) {
		struct rt6key *key = (struct rt6key *)((u8 *)fn->leaf + offset);
		if (plen < fn->fn_bit ||
		    !ipv6_prefix_equal(&key->addr, addr, fn->fn_bit))
			return NULL;
		if (plen == fn->fn_bit)
			return fn;
		if (addr_bit_set(addr, fn->fn_bit))
			fn = fn->right;
		else
			fn = fn->left;
	}
	return NULL;
}