Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88178
b: refs/heads/master
c: 61407f8
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and David S. Miller committed Apr 3, 2008
1 parent a501637 commit 6a70f3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84f59370c519449c70dcc813b050f5cbbf0098e7
refs/heads/master: 61407f80f72970d52d4339f81c6c3cd03f4ca0f0
13 changes: 9 additions & 4 deletions trunk/lib/random32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 6a70f3e

Please sign in to comment.