ipv6: Use universal hash for NDISC.
[deliverable/linux.git] / include / net / ndisc.h
index 62beeb97c4b16ac569165882440b820edf61ca29..e9c30023b784ab376eb7755bbaaf788ef5bb9e20 100644 (file)
@@ -79,6 +79,15 @@ struct nd_opt_hdr {
        __u8            nd_opt_len;
 } __packed;
 
+static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, __u32 *hash_rnd)
+{
+       const u32 *p32 = pkey;
+
+       return (((p32[0] ^ dev->ifindex) * hash_rnd[0]) +
+               (p32[1] * hash_rnd[1]) +
+               (p32[2] * hash_rnd[2]) +
+               (p32[3] * hash_rnd[3]));
+}
 
 extern int                     ndisc_init(void);
 
@@ -145,13 +154,4 @@ int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl,
 extern void                    inet6_ifinfo_notify(int event,
                                                    struct inet6_dev *idev);
 
-static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr)
-{
-
-       if (dev)
-               return __neigh_lookup_errno(&nd_tbl, addr, dev);
-
-       return ERR_PTR(-ENODEV);
-}
-
 #endif
This page took 0.023913 seconds and 5 git commands to generate.