diff options
author | Eric Dumazet <edumazet@google.com> | 2013-09-24 06:19:57 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-13 16:08:30 -0700 |
commit | bdf831a681dd237fcde669e07e5202daddfa0c65 (patch) | |
tree | 53757db6bc886734764c24f2cab134a6f0540674 /net/ipv4 | |
parent | 6ea2edb3b6cbe72d2f943e205c463f6cb8bafe56 (diff) | |
download | linux-3.10-bdf831a681dd237fcde669e07e5202daddfa0c65.tar.gz linux-3.10-bdf831a681dd237fcde669e07e5202daddfa0c65.tar.bz2 linux-3.10-bdf831a681dd237fcde669e07e5202daddfa0c65.zip |
net: net_secret should not depend on TCP
[ Upstream commit 9a3bab6b05383f1e4c3716b3615500c51285959e ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4')
-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 d01be2a3ae5..c4adc319cc2 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); |