From 5738cb517394d0d034acaa52df936b3b0b13a361 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 20 Jul 2021 20:31:49 +0200 Subject: [PATCH] Slightly better RNG seed for tincctl. This prevents the Port from being the same when initializing multiple instances of tinc in a short timespan. --- src/tincctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tincctl.c b/src/tincctl.c index a6b400b9..de171e60 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -3374,7 +3374,8 @@ int main(int argc, char *argv[]) { #endif - srand(time(NULL)); + gettimeofday(&now, NULL); + srand(now.tv_sec + now.tv_usec); crypto_init(); if(optind >= argc) { -- 2.20.1