utils.c (b05005772f34497eb2b7415a651fe785cbe70e16) utils.c (6f912042256c12b0927438122594f5379b364f5d)
1/*
2 * Generic address resultion entity
3 *
4 * Authors:
5 * net_random Alan Cox
6 * net_ratelimit Andy Kleen
7 *
8 * Created by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>

--- 107 unchanged lines hidden (view full) ---

116 __net_srandom(state, state->s1^entropy);
117 put_cpu_var(state);
118}
119
120void __init net_random_init(void)
121{
122 int i;
123
1/*
2 * Generic address resultion entity
3 *
4 * Authors:
5 * net_random Alan Cox
6 * net_ratelimit Andy Kleen
7 *
8 * Created by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>

--- 107 unchanged lines hidden (view full) ---

116 __net_srandom(state, state->s1^entropy);
117 put_cpu_var(state);
118}
119
120void __init net_random_init(void)
121{
122 int i;
123
124 for_each_cpu(i) {
124 for_each_possible_cpu(i) {
125 struct nrnd_state *state = &per_cpu(net_rand_state,i);
126 __net_srandom(state, i+jiffies);
127 }
128}
129
130static int net_random_reseed(void)
131{
132 int i;
133 unsigned long seed[NR_CPUS];
134
135 get_random_bytes(seed, sizeof(seed));
125 struct nrnd_state *state = &per_cpu(net_rand_state,i);
126 __net_srandom(state, i+jiffies);
127 }
128}
129
130static int net_random_reseed(void)
131{
132 int i;
133 unsigned long seed[NR_CPUS];
134
135 get_random_bytes(seed, sizeof(seed));
136 for_each_cpu(i) {
136 for_each_possible_cpu(i) {
137 struct nrnd_state *state = &per_cpu(net_rand_state,i);
138 __net_srandom(state, seed[i]);
139 }
140 return 0;
141}
142late_initcall(net_random_reseed);
143
144int net_msg_cost = 5*HZ;

--- 48 unchanged lines hidden ---
137 struct nrnd_state *state = &per_cpu(net_rand_state,i);
138 __net_srandom(state, seed[i]);
139 }
140 return 0;
141}
142late_initcall(net_random_reseed);
143
144int net_msg_cost = 5*HZ;

--- 48 unchanged lines hidden ---