Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
Index: net-2.6.14/net/ipv6/ip6_fib.c
===================================================================
--- net-2.6.14.orig/net/ipv6/ip6_fib.c
+++ net-2.6.14/net/ipv6/ip6_fib.c
@@ -588,33 +588,35 @@ struct lookup_args {
struct in6_addr *addr; /* search key */
};
-static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
- struct lookup_args *args)
+static inline struct fib6_node *fib6_descend_tree(struct fib6_node *root,
+ struct lookup_args *args)
{
- struct fib6_node *fn;
- int dir;
-
- /*
- * Descend on a tree
- */
-
- fn = root;
+ struct fib6_node *fn = root;
for (;;) {
struct fib6_node *next;
- dir = addr_bit_set(args->addr, fn->fn_bit);
-
- next = dir ? fn->right : fn->left;
+ if (addr_bit_set(args->addr, fn->fn_bit))
+ next = fn->right;
+ else
+ next = fn->left;
- if (next) {
- fn = next;
- continue;
- }
+ if (!next)
+ break;
- break;
+ fn = next;
}
+ return fn;
+}
+
+static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
+ struct lookup_args *args)
+{
+ struct fib6_node *fn;
+
+ fn = fib6_descend_tree(root, args);
+
while (!fib6_root_node(fn)) {
#ifdef CONFIG_IPV6_SUBTREES
if (fn->subtree) {
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html