summaryrefslogtreecommitdiff
path: root/net/netfilter/xt_hashlimit.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2013-12-19 18:25:14 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-20 10:21:40 +0100
commita42b99a6e329654d376b330de057eff87686d890 (patch)
tree6c03a35feddd49e54e19b89576f0b6818b7bb1a7 /net/netfilter/xt_hashlimit.c
parent8cf4d6a224a0226987d9cba69cb46d93814fe449 (diff)
netfilter: avoid get_random_bytes calls
All these users need an initial seed value for jhash, prandom is perfectly fine. This avoids draining the entropy pool where its not strictly required. nfnetlink_log did not use the random value at all. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/xt_hashlimit.c')
-rw-r--r--net/netfilter/xt_hashlimit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 9ff035c71403..a83a35c81150 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -177,7 +177,7 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht,
/* initialize hash with random val at the time we allocate
* the first hashtable entry */
if (unlikely(!ht->rnd_initialized)) {
- get_random_bytes(&ht->rnd, sizeof(ht->rnd));
+ ht->rnd = prandom_u32();
ht->rnd_initialized = true;
}