summaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2014-07-24 16:50:30 +0200
committerDavid S. Miller <davem@davemloft.net>2014-07-27 22:34:35 -0700
commitfb3cfe6e75b9d05c87265e85e67d7caf6e5b44a7 (patch)
tree3dfe9c9ddebc20bd61571db6d23ff660a67a3485 /net/ieee802154
parent36c7778218b93d96d88d68f116a711f6a598b72f (diff)
downloadop-kernel-dev-fb3cfe6e75b9d05c87265e85e67d7caf6e5b44a7.zip
op-kernel-dev-fb3cfe6e75b9d05c87265e85e67d7caf6e5b44a7.tar.gz
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 <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/reassembly.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
index a5588be..a707995 100644
--- a/net/ieee802154/reassembly.c
+++ b/net/ieee802154/reassembly.c
@@ -50,15 +50,11 @@ static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size,
const struct ieee802154_addr *saddr,
const struct ieee802154_addr *daddr)
{
- u32 c;
-
net_get_random_once(&lowpan_frags.rnd, sizeof(lowpan_frags.rnd));
- c = jhash_3words(ieee802154_addr_hash(saddr),
- ieee802154_addr_hash(daddr),
- (__force u32)(tag + (d_size << 16)),
- lowpan_frags.rnd);
-
- return c & (INETFRAGS_HASHSZ - 1);
+ return jhash_3words(ieee802154_addr_hash(saddr),
+ ieee802154_addr_hash(daddr),
+ (__force u32)(tag + (d_size << 16)),
+ lowpan_frags.rnd);
}
static unsigned int lowpan_hashfn(const struct inet_frag_queue *q)
OpenPOWER on IntegriCloud