projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
lib: uuid: Fix unseeded PRNG on RANDOM_UUID=y
[oweals/u-boot.git]
/
lib
/
uuid.c
diff --git
a/lib/uuid.c
b/lib/uuid.c
index fa20ee39fc3205e24b77f6faf86b5960b1ae0560..2d4d6ef7e461d15e85cf3a4dbd9a842af1b467bf 100644
(file)
--- a/
lib/uuid.c
+++ b/
lib/uuid.c
@@
-238,6
+238,8
@@
void gen_rand_uuid(unsigned char *uuid_bin)
unsigned int *ptr = (unsigned int *)&uuid;
int i;
+ srand(get_ticks() + rand());
+
/* Set all fields randomly */
for (i = 0; i < sizeof(struct uuid) / sizeof(*ptr); i++)
*(ptr + i) = cpu_to_be32(rand());