Skip to content

Instantly share code, notes, and snippets.

@ronin13
Created May 27, 2015 14:14
Show Gist options
  • Save ronin13/b08faf84a88a04d89019 to your computer and use it in GitHub Desktop.
Save ronin13/b08faf84a88a04d89019 to your computer and use it in GitHub Desktop.
net_get_random_once(&inet_ehash_secret, sizeof(inet_ehash_secret));
return __inet_ehashfn(laddr, lport, faddr, fport,
inet_ehash_secret + net_hash_mix(net));
...............
...........
static inline unsigned int __inet_ehashfn(const __be32 laddr,
const __u16 lport,
const __be32 faddr,
const __be16 fport,
u32 initval)
{
return jhash_3words((__force __u32) laddr,
(__force __u32) faddr,
((__u32) lport) << 16 | (__force __u32)fport,
initval);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment