[Olsr-dev] [PATCH v1 1/4] main: do not seed the random number generator with the process id

Ferry Huberts (spam-protected)
Fri Nov 9 17:59:38 CET 2012


From: Ferry Huberts <(spam-protected)>

This is entirely too predictable

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index 2ba0757..014d2db 100644
--- a/src/main.c
+++ b/src/main.c
@@ -297,7 +297,7 @@ int main(int argc, char *argv[]) {
   olsr_openlog("olsrd");
 
   /* Using PID as random seed */
-  srandom(getpid());
+  srandom(random());
 
   /* Init widely used statics */
   memset(&all_zero, 0, sizeof(union olsr_ip_addr));
-- 
1.7.11.7





More information about the Olsr-dev mailing list