From af7441a66d1e3cfb43e0a00785b1636b927f40e6 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Sat, 24 Dec 2016 19:41:25 +0100 Subject: ipcpd: Use high resolution seed for flat policy This avoids normal ipcps using the flat address policy having a high probability for picking the same address when created from a script. --- src/ipcpd/normal/pol/flat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ipcpd') diff --git a/src/ipcpd/normal/pol/flat.c b/src/ipcpd/normal/pol/flat.c index 0ab1e604..8a0570f8 100644 --- a/src/ipcpd/normal/pol/flat.c +++ b/src/ipcpd/normal/pol/flat.c @@ -133,9 +133,12 @@ int flat_init(void) { struct ro_attr rattr; pthread_condattr_t cattr; + struct timespec t; char * name; - srand(time(NULL)); + clock_gettime(CLOCK_REALTIME, &t); + + srand(t.tv_nsec); flat.addr_in_use = false; ro_attr_init(&rattr); -- cgit v1.2.3