aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-10 02:42:08 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-12 00:43:15 -0400
commit3eb84f49290461e2b83d6e8ee1f3f0e504340c8b (patch)
tree5363f47792e3e41921a86e1695f378a8555795f4
parentfed85383ac34d82e96f227ce49ce68117cec23a0 (diff)
[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>
-rw-r--r--include/net/addrconf.h19
-rw-r--r--net/ipv6/addrconf.c19
2 files changed, 19 insertions, 19 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 1dc9d03372d9..1ba4e5bf5801 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -189,25 +189,6 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
189#define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt) 189#define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt)
190 190
191 191
192/*
193 * Hash function taken from net_alias.c
194 */
195
196static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr)
197{
198 __u32 word;
199
200 /*
201 * We perform the hash function over the last 64 bits of the address
202 * This will include the IEEE address token on links that support it.
203 */
204
205 word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]);
206 word ^= (word >> 16);
207 word ^= (word >> 8);
208
209 return ((word ^ (word >> 4)) & 0x0f);
210}
211 192
212/* 193/*
213 * compute link-local solicited-node multicast address 194 * compute link-local solicited-node multicast address
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)
541 *ifap = ifp; 541 *ifap = ifp;
542} 542}
543 543
544/*
545 * Hash function taken from net_alias.c
546 */
547static u8 ipv6_addr_hash(const struct in6_addr *addr)
548{
549 __u32 word;
550
551 /*
552 * We perform the hash function over the last 64 bits of the address
553 * This will include the IEEE address token on links that support it.
554 */
555
556 word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]);
557 word ^= (word >> 16);
558 word ^= (word >> 8);
559
560 return ((word ^ (word >> 4)) & 0x0f);
561}
562
544/* On success it returns ifp with increased reference count */ 563/* On success it returns ifp with increased reference count */
545 564
546static struct inet6_ifaddr * 565static struct inet6_ifaddr *