mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
inet: frag: remove hash size assumptions from callers
hide actual hash size from individual users: The _find function will now fold the given hash value into the required range. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
36c7778218
commit
fb3cfe6e75
5 changed files with 19 additions and 23 deletions
|
|
@ -147,12 +147,9 @@ static inline u8 ip6_frag_ecn(const struct ipv6hdr *ipv6h)
|
|||
static unsigned int nf_hash_frag(__be32 id, const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr)
|
||||
{
|
||||
u32 c;
|
||||
|
||||
net_get_random_once(&nf_frags.rnd, sizeof(nf_frags.rnd));
|
||||
c = jhash_3words(ipv6_addr_hash(saddr), ipv6_addr_hash(daddr),
|
||||
(__force u32)id, nf_frags.rnd);
|
||||
return c & (INETFRAGS_HASHSZ - 1);
|
||||
return jhash_3words(ipv6_addr_hash(saddr), ipv6_addr_hash(daddr),
|
||||
(__force u32)id, nf_frags.rnd);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -85,13 +85,9 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
|
|||
static unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr)
|
||||
{
|
||||
u32 c;
|
||||
|
||||
net_get_random_once(&ip6_frags.rnd, sizeof(ip6_frags.rnd));
|
||||
c = jhash_3words(ipv6_addr_hash(saddr), ipv6_addr_hash(daddr),
|
||||
(__force u32)id, ip6_frags.rnd);
|
||||
|
||||
return c & (INETFRAGS_HASHSZ - 1);
|
||||
return jhash_3words(ipv6_addr_hash(saddr), ipv6_addr_hash(daddr),
|
||||
(__force u32)id, ip6_frags.rnd);
|
||||
}
|
||||
|
||||
static unsigned int ip6_hashfn(const struct inet_frag_queue *q)
|
||||
|
|
|
|||
Loading…
Reference in a new issue