summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2012-05-28 15:24:33 +0000
committererdgeist <>2012-05-28 15:24:33 +0000
commit3eeb536a44266a208a7287d4d5b57c56fd5d1c8a (patch)
treecdcd848b0615f27d939e6ea4fa6da92b6348f3ba
parentae16a23ae09b78b78b5b0b21129e3ee014ae1e87 (diff)
Init prng before udp code needs it.
-rw-r--r--Makefile2
-rw-r--r--opentracker.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b4bb5d2..ed258e6 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ BINDIR?=$(PREFIX)/bin
35#FEATURES+=-DWANT_MODEST_FULLSCRAPES 35#FEATURES+=-DWANT_MODEST_FULLSCRAPES
36#FEATURES+=-DWANT_SPOT_WOODPECKER 36#FEATURES+=-DWANT_SPOT_WOODPECKER
37#FEATURES+=-DWANT_SYSLOGS 37#FEATURES+=-DWANT_SYSLOGS
38FEATURES+=-DWANT_DEV_RANDOM 38#FEATURES+=-DWANT_DEV_RANDOM
39FEATURES+=-DWANT_FULLSCRAPE 39FEATURES+=-DWANT_FULLSCRAPE
40 40
41#FEATURES+=-D_DEBUG_HTTPERROR 41#FEATURES+=-D_DEBUG_HTTPERROR
diff --git a/opentracker.c b/opentracker.c
index c735393..3e72985 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -562,6 +562,12 @@ int main( int argc, char **argv ) {
562 noipv6=1; 562 noipv6=1;
563#endif 563#endif
564 564
565#ifdef WANT_DEV_RANDOM
566 srandomdev();
567#else
568 srandom( time(NULL) );
569#endif
570
565 while( scanon ) { 571 while( scanon ) {
566 switch( getopt( argc, argv, ":i:p:A:P:d:u:r:s:f:l:v" 572 switch( getopt( argc, argv, ":i:p:A:P:d:u:r:s:f:l:v"
567#ifdef WANT_ACCESSLIST_BLACK 573#ifdef WANT_ACCESSLIST_BLACK
@@ -617,6 +623,9 @@ int main( int argc, char **argv ) {
617 ot_try_bind( serverip, 6969, FLAG_UDP ); 623 ot_try_bind( serverip, 6969, FLAG_UDP );
618 } 624 }
619 625
626 if( !g_udp_workers )
627 udp_init( -1, 0 );
628
620#ifdef WANT_SYSLOGS 629#ifdef WANT_SYSLOGS
621 openlog( "opentracker", 0, LOG_USER ); 630 openlog( "opentracker", 0, LOG_USER );
622 setlogmask(LOG_UPTO(LOG_INFO)); 631 setlogmask(LOG_UPTO(LOG_INFO));