summaryrefslogtreecommitdiffhomepage
path: root/svr-main.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2006-02-11 15:15:37 +0000
committerMatt Johnston <matt@ucc.asn.au>2006-02-11 15:15:37 +0000
commit1eb9209afef2046bbf74f8d2ffb0f357bdb992bb (patch)
treeb399a58bdea3ca21cd2ffac2ec892d6b2009ee4e /svr-main.c
parentfcba907998dd6e38b82cfcc05d632dfdb0baf9d1 (diff)
Only read /dev/random once when the program starts
rather than for every connection, to "conserve entropy". --HG-- extra : convert_revision : 21df240b71c0af8454725dec9abb428dd4bb97a2
Diffstat (limited to 'svr-main.c')
-rw-r--r--svr-main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/svr-main.c b/svr-main.c
index 4641e24..aef00f6 100644
--- a/svr-main.c
+++ b/svr-main.c
@@ -83,7 +83,7 @@ static void main_inetd() {
int remoteaddrlen;
char * addrstring = NULL;
- /* Set up handlers, syslog */
+ /* Set up handlers, syslog, seed random */
commonsetup();
remoteaddrlen = sizeof(remoteaddr);
@@ -359,6 +359,8 @@ static void commonsetup() {
/* Now we can setup the hostkeys - needs to be after logging is on,
* otherwise we might end up blatting error messages to the socket */
loadhostkeys();
+
+ seedrandom();
}
/* Set up listening sockets for all the requested ports */