diff options
author | Eric Dumazet <edumazet@google.com> | 2013-09-24 17:19:57 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-29 02:19:40 +0400 |
commit | 9a3bab6b05383f1e4c3716b3615500c51285959e (patch) | |
tree | e701171f62c8b2dc17fc6d4ba506f8628e304085 /net/ipv4/af_inet.c | |
parent | 50624c934db18ab90aaea4908f60dd39aab4e6e5 (diff) | |
download | linux-9a3bab6b05383f1e4c3716b3615500c51285959e.tar.xz |
net: net_secret should not depend on TCP
A host might need net_secret[] and never open a single socket.
Problem added in commit aebda156a570782
("net: defer net_secret[] initialization")
Based on prior patch from Hannes Frederic Sowa.
Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Hannes Frederic Sowa <hannes@strressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 7a1874b7b8fd..cfeb85cff4f0 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -263,10 +263,8 @@ void build_ehash_secret(void) get_random_bytes(&rnd, sizeof(rnd)); } while (rnd == 0); - if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0) { + if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0) get_random_bytes(&ipv6_hash_secret, sizeof(ipv6_hash_secret)); - net_secret_init(); - } } EXPORT_SYMBOL(build_ehash_secret); |