]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
pluto: Use srand() to initialize the C library PRNG.
authorTobias Brunner <tobias@strongswan.org>
Wed, 4 Jan 2012 12:19:29 +0000 (13:19 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 4 Jan 2012 12:19:29 +0000 (13:19 +0100)
Otherwise rekey and DPD times would always be the same after a restart.

src/pluto/plutomain.c

index 2e046ec0b6ec10e5dc11ce3748a538bb96366220..0f28448133950d05a9413f9b4e9a764a65ec42c1 100644 (file)
@@ -675,6 +675,9 @@ int main(int argc, char **argv)
                close(fd);
        }
 
+       /* for uncritical pseudo random numbers */
+       srand(time(NULL) + getpid());
+
        init_constants();
        init_log("pluto");