Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.14/include/net/ip6_fib.h
===================================================================
--- net-2.6.14.orig/include/net/ip6_fib.h
+++ net-2.6.14/include/net/ip6_fib.h
@@ -124,6 +124,11 @@ struct rt6_statistics {
 #define RTN_ROOT       0x0002          /* tree root node               */
 #define RTN_RTINFO     0x0004          /* node with valid routing info */
 
+static inline int fib6_root_node(struct fib6_node *fn)
+{
+       return fn->fn_flags & RTN_ROOT;
+}
+
 /*
  *     priority levels (or metrics)
  *
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
@@ -615,7 +615,7 @@ static struct fib6_node * fib6_lookup_1(
                break;
        }
 
-       while ((fn->fn_flags & RTN_ROOT) == 0) {
+       while (!fib6_root_node(fn)) {
 #ifdef CONFIG_IPV6_SUBTREES
                if (fn->subtree) {
                        struct fib6_node *st;
@@ -626,7 +626,7 @@ static struct fib6_node * fib6_lookup_1(
                        if (narg->addr) {
                                st = fib6_lookup_1(fn->subtree, narg);
 
-                               if (st && !(st->fn_flags & RTN_ROOT))
+                               if (st && !fib6_root_node(st))
                                        return st;
                        }
                }
@@ -744,7 +744,7 @@ struct fib6_node * fib6_locate(struct fi
 
 static struct rt6_info * fib6_find_prefix(struct fib6_node *fn)
 {
-       if (fn->fn_flags&RTN_ROOT)
+       if (fib6_root_node(fn))
                return &ip6_null_entry;
 
        while(fn) {
@@ -788,7 +788,7 @@ static struct fib6_node * fib6_repair_tr
                if (children == 3 || SUBTREE(fn) 
 #ifdef CONFIG_IPV6_SUBTREES
                    /* Subtree root (i.e. fn) may have one child */
-                   || (children && fn->fn_flags&RTN_ROOT)
+                   || (children && fib6_root_node(fn))
 #endif
                    ) {
                        fn->leaf = fib6_find_prefix(fn);
@@ -805,11 +805,11 @@ static struct fib6_node * fib6_repair_tr
                pn = fn->parent;
 #ifdef CONFIG_IPV6_SUBTREES
                if (SUBTREE(pn) == fn) {
-                       BUG_TRAP(fn->fn_flags&RTN_ROOT);
+                       BUG_TRAP(fib6_root_node(fn));
                        SUBTREE(pn) = NULL;
                        nstate = FWS_L;
                } else {
-                       BUG_TRAP(!(fn->fn_flags&RTN_ROOT));
+                       BUG_TRAP(!fib6_root_node(fn));
 #endif
                        if (pn->right == fn) pn->right = child;
                        else if (pn->left == fn) pn->left = child;
@@ -1033,7 +1033,7 @@ int fib6_walk_continue(struct fib6_walke
                        w->node = pn;
 #ifdef CONFIG_IPV6_SUBTREES
                        if (SUBTREE(pn) == fn) {
-                               BUG_TRAP(fn->fn_flags&RTN_ROOT);
+                               BUG_TRAP(fib6_root_node(fn));
                                w->state = FWS_L;
                                continue;
                        }
Index: net-2.6.14/net/ipv6/route.c
===================================================================
--- net-2.6.14.orig/net/ipv6/route.c
+++ net-2.6.14/net/ipv6/route.c
@@ -448,7 +448,7 @@ static struct rt6_info *rt6_cow(struct r
 #define BACKTRACK() \
 if (rt == &ip6_null_entry && strict) { \
        while ((fn = fn->parent) != NULL) { \
-               if (fn->fn_flags & RTN_ROOT) { \
+               if (fib6_root_node(fn)) { \
                        dst_hold(&rt->u.dst); \
                        goto out; \
                } \

-
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

Reply via email to