From e5cc69e45d15a4ef967e14508d20a394f22c95e7 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 12 Jan 2008 21:49:01 -0800 Subject: [PATCH] --- yaml --- r: 78787 b: refs/heads/master c: 88ebc72f68974965b41ad7e8e441df57a530e386 h: refs/heads/master i: 78785: cd71d0a914343c489263b9da6b3a4b4f37cd4154 78783: 4f15116cfbe121d7cd29b07d1d7e46850347a8fd v: v3 --- [refs] | 2 +- trunk/net/ipv4/fib_semantics.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index f31947300326..c37dcbca0ba7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3f4afb6443aaa1d69b2d8f0461c8191e40d54c3c +refs/heads/master: 88ebc72f68974965b41ad7e8e441df57a530e386 diff --git a/trunk/net/ipv4/fib_semantics.c b/trunk/net/ipv4/fib_semantics.c index 3ed920b92fb6..0e08df4d6f9a 100644 --- a/trunk/net/ipv4/fib_semantics.c +++ b/trunk/net/ipv4/fib_semantics.c @@ -194,6 +194,15 @@ static __inline__ int nh_comp(const struct fib_info *fi, const struct fib_info * return 0; } +static inline unsigned int fib_devindex_hashfn(unsigned int val) +{ + unsigned int mask = DEVINDEX_HASHSIZE - 1; + + return (val ^ + (val >> DEVINDEX_HASHBITS) ^ + (val >> (DEVINDEX_HASHBITS * 2))) & mask; +} + static inline unsigned int fib_info_hashfn(const struct fib_info *fi) { unsigned int mask = (fib_hash_size - 1); @@ -202,6 +211,9 @@ static inline unsigned int fib_info_hashfn(const struct fib_info *fi) val ^= fi->fib_protocol; val ^= (__force u32)fi->fib_prefsrc; val ^= fi->fib_priority; + for_nexthops(fi) { + val ^= fib_devindex_hashfn(nh->nh_oif); + } endfor_nexthops(fi) return (val ^ (val >> 7) ^ (val >> 12)) & mask; } @@ -232,15 +244,6 @@ static struct fib_info *fib_find_info(const struct fib_info *nfi) return NULL; } -static inline unsigned int fib_devindex_hashfn(unsigned int val) -{ - unsigned int mask = DEVINDEX_HASHSIZE - 1; - - return (val ^ - (val >> DEVINDEX_HASHBITS) ^ - (val >> (DEVINDEX_HASHBITS * 2))) & mask; -} - /* Check, that the gateway is already configured. Used only by redirect accept routine. */