diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2014-10-18 22:15:11 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2014-10-18 22:15:11 +0000 |
commit | 99e9de871aee402a1166cdecb957fe6c8c99da13 (patch) | |
tree | aa13f053d13bd078b46dd640e041ab6d63d35d63 /sys/netpfil/pf | |
parent | 78701de4b75738036124ea6ce68a3da9cdf6f632 (diff) | |
download | src-99e9de871aee402a1166cdecb957fe6c8c99da13.tar.gz src-99e9de871aee402a1166cdecb957fe6c8c99da13.zip |
Add a complete implementation of MurmurHash3. Tweak both implementations
so they match the established idiom. Document them in hash(9).
MFC after: 1 month
MFC with: r272906
Notes
Notes:
svn path=/head/; revision=273268
Diffstat (limited to 'sys/netpfil/pf')
-rw-r--r-- | sys/netpfil/pf/pf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ac4a154ac347..16cd7fbfe96f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -374,9 +374,9 @@ pf_hashkey(struct pf_state_key *sk) { uint32_t h; - h = murmur3_aligned_32((uint32_t *)sk, - sizeof(struct pf_state_key_cmp), - V_pf_hashseed); + h = murmur3_32_hash32((uint32_t *)sk, + sizeof(struct pf_state_key_cmp)/sizeof(uint32_t), + V_pf_hashseed); return (h & pf_hashmask); } @@ -388,12 +388,12 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) switch (af) { case AF_INET: - h = murmur3_aligned_32((uint32_t *)&addr->v4, - sizeof(addr->v4), V_pf_hashseed); + h = murmur3_32_hash32((uint32_t *)&addr->v4, + sizeof(addr->v4)/sizeof(uint32_t), V_pf_hashseed); break; case AF_INET6: - h = murmur3_aligned_32((uint32_t *)&addr->v6, - sizeof(addr->v6), V_pf_hashseed); + h = murmur3_32_hash32((uint32_t *)&addr->v6, + sizeof(addr->v6)/sizeof(uint32_t), V_pf_hashseed); break; default: panic("%s: unknown address family %u", __func__, af); |