Merge branch 'episys/master' into episys-merge
Conflicts: common/utils/LOG/log.h common/utils/ocp_itti/intertask_interface.cpp nfapi/oai_integration/nfapi_vnf.c nfapi/open-nFAPI/nfapi/src/nfapi.c openair2/LAYER2/MAC/main_ue.c openair2/LAYER2/PDCP_v10.1.0/pdcp.c openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c openair2/PHY_INTERFACE/phy_stub_UE.c openair2/RRC/LTE/rrc_UE.c openair2/RRC/LTE/rrc_eNB.c openair3/NAS/UE/ESM/esm_ebr_context.c targets/COMMON/openairinterface5g_limits.h targets/RT/USER/lte-softmodem.c targets/RT/USER/lte-uesoftmodem.c
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
//#include "SIMULATION/TOOLS/sim.h"
|
||||
|
||||
|
||||
unsigned int s0, s1, s2, b;
|
||||
static unsigned int s0, s1, s2;
|
||||
|
||||
//----------------------------------------------
|
||||
//
|
||||
@@ -34,7 +34,7 @@ unsigned int s0, s1, s2, b;
|
||||
|
||||
unsigned int taus(void)
|
||||
{
|
||||
b = (((s0 << 13) ^ s0) >> 19);
|
||||
unsigned int b = (((s0 << 13) ^ s0) >> 19);
|
||||
s0 = (((s0 & 0xFFFFFFFE) << 12)^ b);
|
||||
b = (((s1 << 2) ^ s1) >> 25);
|
||||
s1 = (((s1 & 0xFFFFFFF8) << 4)^ b);
|
||||
@@ -50,9 +50,20 @@ void set_taus_seed(unsigned int seed_init)
|
||||
unsigned long result = 0;
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
unsigned int data[3];
|
||||
int fd = open("/dev/urandom", O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
if (read(fd, data, sizeof(data)) != sizeof(data))
|
||||
{
|
||||
abort();
|
||||
}
|
||||
close(fd);
|
||||
s0 = data[0];
|
||||
s1 = data[1];
|
||||
s2 = data[2];
|
||||
} else {
|
||||
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
|
||||
Reference in New Issue
Block a user