X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=b6c4fc89ad1014086cca57a88efc16ab5cf35fcc;hb=6debc6c79ba385d35f646e0958f84ace5b8f4b4d;hp=a144636951f2b3dc4db0a6276b712fc2fc7101a2;hpb=b2701c7c54b11cda71461c5dbbc985476bf5b221;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index a1446369..b6c4fc89 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -2127,7 +2127,7 @@ int check_port(const char *name) { fprintf(stderr, "Warning: could not bind to port 655. "); for(int i = 0; i < 100; i++) { - int port = 0x1000 + (rand() & 0x7fff); + uint16_t port = 0x1000 + prng(0x8000); if(try_bind(port)) { char filename[PATH_MAX]; @@ -3302,8 +3302,8 @@ int main(int argc, char *argv[]) { #endif gettimeofday(&now, NULL); - srand(now.tv_sec + now.tv_usec); crypto_init(); + prng_init(); if(optind >= argc) { return cmd_shell(argc, argv);