diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-07 19:36:57 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-07 19:36:57 +0400 |
commit | 4cac04dd63fa3b202ee313ed1afbbd135ab887ee (patch) | |
tree | 8fa7ed0186030297c69ac95530853eb5c860a894 /lib/random32.c | |
parent | e1c287b992d30dab86f1b1bfe1780d9d3a652b34 (diff) | |
parent | bfe87dbc7b4da5b05a1a78480e996787a500cc6f (diff) | |
download | linux-4cac04dd63fa3b202ee313ed1afbbd135ab887ee.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
fix endian lossage in forcedeth
net/tokenring/olympic.c section fixes
net: marvell.c fix sparse shadowed variable warning
[VLAN]: Fix egress priority mappings leak.
[TG3]: Add PHY workaround for 5784
[NET]: srandom32 fixes for networking v2
[IPV6]: Fix refcounting for anycast dst entries.
[IPV6]: inet6_dev on loopback should be kept until namespace stop.
[IPV6]: Event type in addrconf_ifdown is mis-used.
[ICMP]: Ensure that ICMP relookup maintains status quo
Diffstat (limited to 'lib/random32.c')
-rw-r--r-- | lib/random32.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/random32.c b/lib/random32.c index ec7f81d3fb18..ca87d86992bd 100644 --- a/lib/random32.c +++ b/lib/random32.c @@ -97,13 +97,18 @@ EXPORT_SYMBOL(random32); * @seed: seed value * * Add some additional seeding to the random32() pool. - * Note: this pool is per cpu so it only affects current CPU. */ void srandom32(u32 entropy) { - struct rnd_state *state = &get_cpu_var(net_rand_state); - __set_random32(state, state->s1 ^ entropy); - put_cpu_var(state); + int i; + /* + * No locking on the CPUs, but then somewhat random results are, well, + * expected. + */ + for_each_possible_cpu (i) { + struct rnd_state *state = &per_cpu(net_rand_state, i); + __set_random32(state, state->s1 ^ entropy); + } } EXPORT_SYMBOL(srandom32); |