Commit e24181d0 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[IPV4]: Size fib_info_devhash[] correctly.

There is a thinko in the allocation for the devindex hash.  We're
only giving it 8 elements when it should be 1<<8 elements.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent face9279
......@@ -52,7 +52,8 @@ static unsigned int fib_hash_size;
static unsigned int fib_info_cnt;
#define DEVINDEX_HASHBITS 8
static struct hlist_head fib_info_devhash[DEVINDEX_HASHBITS];
#define DEVINDEX_HASHSIZE (1U << DEVINDEX_HASHBITS)
static struct hlist_head fib_info_devhash[DEVINDEX_HASHSIZE];
#ifdef CONFIG_IP_ROUTE_MULTIPATH
......@@ -229,7 +230,7 @@ static struct fib_info *fib_find_info(const struct fib_info *nfi)
static inline unsigned int fib_devindex_hashfn(unsigned int val)
{
unsigned int mask = ((1U << DEVINDEX_HASHBITS) - 1);
unsigned int mask = DEVINDEX_HASHSIZE - 1;
return (val ^
(val >> DEVINDEX_HASHBITS) ^
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment