[IPV6] ADDRCONF: Uninline ipv6_addr_hash().
[safe/jmp/linux-2.6] / include / net / addrconf.h
index d89b0bc..1ba4e5b 100644 (file)
@@ -71,6 +71,10 @@ extern int                   ipv6_chk_addr(struct net *net,
 extern int                     ipv6_chk_home_addr(struct net *net,
                                                   struct in6_addr *addr);
 #endif
+
+extern int                     ipv6_chk_prefix(struct in6_addr *addr,
+                                               struct net_device *dev);
+
 extern struct inet6_ifaddr      *ipv6_get_ifaddr(struct net *net,
                                                 struct in6_addr *addr,
                                                 struct net_device *dev,
@@ -185,25 +189,6 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
 #define in6_ifa_hold(ifp)      atomic_inc(&(ifp)->refcnt)
 
 
-/*
- *     Hash function taken from net_alias.c
- */
-
-static __inline__ 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);
-}
 
 /*
  *     compute link-local solicited-node multicast address
@@ -236,18 +221,16 @@ static inline int ipv6_addr_is_multicast(const struct in6_addr *addr)
 
 static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
 {
-       return (addr->s6_addr32[0] == htonl(0xff020000) &&
-               addr->s6_addr32[1] == 0 &&
-               addr->s6_addr32[2] == 0 &&
-               addr->s6_addr32[3] == htonl(0x00000001));
+       return (((addr->s6_addr32[0] ^ htonl(0xff020000)) |
+               addr->s6_addr32[1] | addr->s6_addr32[2] |
+               (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0);
 }
 
 static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr)
 {
-       return (addr->s6_addr32[0] == htonl(0xff020000) &&
-               addr->s6_addr32[1] == 0 &&
-               addr->s6_addr32[2] == 0 &&
-               addr->s6_addr32[3] == htonl(0x00000002));
+       return (((addr->s6_addr32[0] ^ htonl(0xff020000)) |
+               addr->s6_addr32[1] | addr->s6_addr32[2] |
+               (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0);
 }
 
 static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr)