From: Wouter Wijngaards Date: Mon, 30 Jul 2007 09:27:49 +0000 (+0000) Subject: random number seed pid-tid fixup, todo. X-Git-Tag: release-0.4~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc4d8d2838d8c08512b91e342c9aeada47efcf47;p=thirdparty%2Funbound.git random number seed pid-tid fixup, todo. git-svn-id: file:///svn/unbound/trunk@463 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/worker.c b/daemon/worker.c index 994a7d0c2..e326eb5b0 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -651,7 +651,8 @@ worker_init(struct worker* worker, struct config_file *cfg, return 0; } seed = (unsigned int)time(NULL) ^ (unsigned int)getpid() ^ - (unsigned int)worker->thread_num; + (((unsigned int)worker->thread_num)<<17); + /* shift thread_num so it does not match out pid bits */ if(!ub_initstate(seed, worker->rndstate, RND_STATE_SIZE)) { log_err("could not init random numbers."); worker_delete(worker); diff --git a/doc/Changelog b/doc/Changelog index 7f46e2996..61706b716 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +30 July 2007: Wouter + - changed random state init, so that sequential process IDs are not + cancelled out by sequential thread-ids in the random number seed. + 27 July 2007: Wouter - removed useless -C debug option. It did not work. - text edit of documentation. diff --git a/doc/TODO b/doc/TODO index a7e2faa50..44f3d184b 100644 --- a/doc/TODO +++ b/doc/TODO @@ -24,3 +24,5 @@ o check query, option to enforce presence of qdsection in noerror answers. o configuration option where port 53 is used for send and receive, no other ports are used. o prime sequence in multiple queries, if glue missing from prime sequence. +o (option) to not send replies to clients after a timeout of (say 5 secs) has + passed, but keep task active for later retries by client.