diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-10 10:42:08 +0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-12 08:43:15 +0400 |
commit | 3eb84f49290461e2b83d6e8ee1f3f0e504340c8b (patch) | |
tree | 5363f47792e3e41921a86e1695f378a8555795f4 /net/ipv6/addrconf.c | |
parent | fed85383ac34d82e96f227ce49ce68117cec23a0 (diff) | |
download | linux-3eb84f49290461e2b83d6e8ee1f3f0e504340c8b.tar.xz |
[IPV6] ADDRCONF: Uninline ipv6_addr_hash().
The function is only used in net/ipv6/addrconf.c.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index ed9938014cf9..b17fafc56241 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -541,6 +541,25 @@ ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) *ifap = ifp; } +/* + * Hash function taken from net_alias.c + */ +static u8 ipv6_addr_hash(const struct in6_addr *addr) +{ + __u32 word; + + /* + * We perform the hash function over the last 64 bits of the address + * This will include the IEEE address token on links that support it. + */ + + word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]); + word ^= (word >> 16); + word ^= (word >> 8); + + return ((word ^ (word >> 4)) & 0x0f); +} + /* On success it returns ifp with increased reference count */ static struct inet6_ifaddr * |