mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Tighten up the random seeding a little bit more. getpid() alone only
affect only lower bits of seed which would resulte in the same seed for sequences of fast-started awk's resulting the same random sequence. Submitted by: ache
This commit is contained in:
parent
5daeec1454
commit
9c23373c4e
1 changed files with 2 additions and 1 deletions
|
|
@ -1509,7 +1509,8 @@ do_srand(NODE *tree)
|
|||
|
||||
if (tree == NULL)
|
||||
#ifdef __FreeBSD__
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0) ^ getpid()));
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0)
|
||||
^ (getpid() << 16)));
|
||||
#else
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0)));
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue