[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B6F93@saturn3.aculab.com>
Date: Wed, 18 Jul 2012 13:28:13 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Eric Dumazet" <eric.dumazet@...il.com>,
"David Miller" <davem@...emloft.net>
Cc: "netdev" <netdev@...r.kernel.org>,
"Andrew McGregor" <andrewmcgr@...il.com>,
"Dave Taht" <dave.taht@...il.com>,
"Tom Herbert" <therbert@...gle.com>
Subject: RE: [PATCH net-next] ipv6: add ipv6_addr_hash() helper
> #define HASH_SIZE 32
>
> -#define HASH(addr) ((__force u32)((addr)->s6_addr32[0] ^ (addr)->s6_addr32[1] ^ \
> - (addr)->s6_addr32[2] ^ (addr)->s6_addr32[3]) & \
> - (HASH_SIZE - 1))
> +#define HASH(addr) (ipv6_addr_hash(addr) & (HASH_SIZE - 1))
That hash doesn't seem to include many variable bits at all!
Especially on LE systems where it doesn't contain any of
the low bits of a mac address based IPv6 address.
David
Powered by blists - more mailing lists