]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
random number seed pid-tid fixup, todo.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 30 Jul 2007 09:27:49 +0000 (09:27 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 30 Jul 2007 09:27:49 +0000 (09:27 +0000)
git-svn-id: file:///svn/unbound/trunk@463 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog
doc/TODO

index 994a7d0c227bd94d3c164a210d9f76fa8916e9f6..e326eb5b04f16f4f96bb21f1a6cf3363be290d88 100644 (file)
@@ -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);
index 7f46e29964f64b2a519f8e8ec7d9340e1bc2a853..61706b716ed1ad551eecc5bf51fc1774e422c071 100644 (file)
@@ -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.
index a7e2faa5039b1c9cd3f815ea7c69b880baeb0562..44f3d184b59ad11845cebcfb22209d150aa63485 100644 (file)
--- 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.