aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-14 05:30:23 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-14 05:30:23 -0400
commitdf39e8ba56a788733d369068c7319e04b1da3cd5 (patch)
tree1e9be853bdb455e341cdbf957656f342cfa2eb9e /lib
parentf5572855ec492334d8c3ec0e0e86c31865d5cf07 (diff)
parent159d83363b629c91d020734207c1bc788b96af5a (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/ehea/ehea_main.c drivers/net/wireless/iwlwifi/Kconfig drivers/net/wireless/rt2x00/rt61pci.c net/ipv4/inet_timewait_sock.c net/ipv6/raw.c net/mac80211/ieee80211_sta.c
Diffstat (limited to 'lib')
-rw-r--r--lib/random32.c13
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);
97 * @seed: seed value 97 * @seed: seed value
98 * 98 *
99 * Add some additional seeding to the random32() pool. 99 * Add some additional seeding to the random32() pool.
100 * Note: this pool is per cpu so it only affects current CPU.
101 */ 100 */
102void srandom32(u32 entropy) 101void srandom32(u32 entropy)
103{ 102{
104 struct rnd_state *state = &get_cpu_var(net_rand_state); 103 int i;
105 __set_random32(state, state->s1 ^ entropy); 104 /*
106 put_cpu_var(state); 105 * No locking on the CPUs, but then somewhat random results are, well,
106 * expected.
107 */
108 for_each_possible_cpu (i) {
109 struct rnd_state *state = &per_cpu(net_rand_state, i);
110 __set_random32(state, state->s1 ^ entropy);
111 }
107} 112}
108EXPORT_SYMBOL(srandom32); 113EXPORT_SYMBOL(srandom32);
109 114