mirror of
https://github.com/opnsense/src.git
synced 2026-07-16 12:33:07 -04:00
Revert "Fix race between first rand(3) calls."
It is going to be reimplemented with _once().
This reverts commit 28d70deaaf.
MFC after: 1 month
This commit is contained in:
parent
23ecfa9d5b
commit
2ae65d449f
1 changed files with 2 additions and 7 deletions
|
|
@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
|
|||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <machine/atomic.h>
|
||||
#include "un-namespace.h"
|
||||
|
||||
#include "random.h"
|
||||
|
|
@ -69,15 +68,11 @@ static struct __random_state *rand3_state;
|
|||
static void
|
||||
initialize_rand3(void)
|
||||
{
|
||||
struct __random_state *state;
|
||||
int error;
|
||||
|
||||
state = allocatestate(TYPE_3);
|
||||
error = initstate_r(state, 1, state->rst_randtbl, BREAK_3);
|
||||
rand3_state = allocatestate(TYPE_3);
|
||||
error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3);
|
||||
assert(error == 0);
|
||||
if (!atomic_cmpset_rel_ptr((volatile uintptr_t *)&rand3_state,
|
||||
(uintptr_t)NULL, (uintptr_t)state))
|
||||
free(state);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Reference in a new issue