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 @@ -198,6 +198,10 @@ static __inline__ void rt6_release(struc dst_free(&rt->u.dst); } +static inline struct rt6key *fib6_node_key(struct fib6_node *fn, int offset) +{ + return (struct rt6key *) ((u8 *) fn->leaf + offset); +} /* * Routing Table @@ -225,7 +229,7 @@ static struct fib6_node * fib6_add_1(str fn = root; do { - key = (struct rt6key *)((u8 *)fn->leaf + offset); + key = fib6_node_key(fn, offset); /* * Prefix match @@ -635,12 +639,8 @@ static struct fib6_node * fib6_lookup_1( #endif if (fn->fn_flags & RTN_RTINFO) { - struct rt6key *key; - - key = (struct rt6key *) ((u8 *) fn->leaf + - args->offset); - - if (ipv6_prefix_equal(&key->addr, args->addr, key->plen)) + struct rt6key *k = fib6_node_key(fn, args->offset); + if (ipv6_prefix_equal(&k->addr, args->addr, k->plen)) return fn; } @@ -689,7 +689,7 @@ static struct fib6_node * fib6_locate_1( struct fib6_node *fn; for (fn = root; fn ; ) { - struct rt6key *key = (struct rt6key *)((u8 *)fn->leaf + offset); + struct rt6key *key = fib6_node_key(fn, offset); /* * Prefix match
- 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