|
Lines 121-127
void __init net_random_init(void)
Link Here
|
| 121 |
{ |
121 |
{ |
| 122 |
int i; |
122 |
int i; |
| 123 |
|
123 |
|
| 124 |
for (i = 0; i < NR_CPUS; i++) { |
124 |
for_each_cpu(i) { |
| 125 |
struct nrnd_state *state = &per_cpu(net_rand_state,i); |
125 |
struct nrnd_state *state = &per_cpu(net_rand_state,i); |
| 126 |
__net_srandom(state, i+jiffies); |
126 |
__net_srandom(state, i+jiffies); |
| 127 |
} |
127 |
} |
|
Lines 133-139
static int net_random_reseed(void)
Link Here
|
| 133 |
unsigned long seed[NR_CPUS]; |
133 |
unsigned long seed[NR_CPUS]; |
| 134 |
|
134 |
|
| 135 |
get_random_bytes(seed, sizeof(seed)); |
135 |
get_random_bytes(seed, sizeof(seed)); |
| 136 |
for (i = 0; i < NR_CPUS; i++) { |
136 |
for_each_cpu(i) { |
| 137 |
struct nrnd_state *state = &per_cpu(net_rand_state,i); |
137 |
struct nrnd_state *state = &per_cpu(net_rand_state,i); |
| 138 |
__net_srandom(state, seed[i]); |
138 |
__net_srandom(state, seed[i]); |
| 139 |
} |
139 |
} |