From: Guus Sliepen Date: Tue, 20 Jul 2021 18:31:49 +0000 (+0200) Subject: Slightly better RNG seed for tincctl. X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=5738cb517394d0d034acaa52df936b3b0b13a361;p=tinc Slightly better RNG seed for tincctl. This prevents the Port from being the same when initializing multiple instances of tinc in a short timespan. --- 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) {