From: Wouter Wijngaards Date: Thu, 15 Feb 2007 12:54:14 +0000 (+0000) Subject: alloc of table makes it aligned. X-Git-Tag: release-0.0~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f94bd720db612f1e0864aa561bb28a23387ab8f;p=thirdparty%2Funbound.git alloc of table makes it aligned. git-svn-id: file:///svn/unbound/trunk@102 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/worker.c b/daemon/worker.c index 386c8b020..a8da81fdf 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -246,6 +246,11 @@ worker_init(const char* port, int do_ip4, int do_ip6, int do_udp, int do_tcp, return NULL; } /* init random(), large table size. */ + if(!(worker->rndstate = (char*)malloc(RND_STATE_SIZE))) { + log_err("malloc rndtable failed."); + worker_delete(worker); + return NULL; + } if(!initstate(time(NULL)^getpid(), worker->rndstate, RND_STATE_SIZE)) { log_err("could not init random numbers."); worker_delete(worker); diff --git a/daemon/worker.h b/daemon/worker.h index 34575c12d..f27371adf 100644 --- a/daemon/worker.h +++ b/daemon/worker.h @@ -78,7 +78,7 @@ struct worker { socklen_t fwd_addrlen; /** random() table for this worker. */ - char rndstate[RND_STATE_SIZE]; + char* rndstate; }; /** diff --git a/doc/Changelog b/doc/Changelog index 2ae64cc63..73770dfb0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 15 February 2007: Wouter - port to FreeBSD 4.11 Dec Alpha. Also works on Solaris 10 sparc64, Solaris 9, FreeBSD 6, Linux i386 and OSX powerpc. + - malloc rndstate, so that it is aligned for access. 14 February 2007: Wouter - Included configure.ac changes from ldns. diff --git a/testdata/fwd_error.rpl b/testdata/fwd_error.rpl index 753419e23..f492cef3f 100644 --- a/testdata/fwd_error.rpl +++ b/testdata/fwd_error.rpl @@ -1,4 +1,4 @@ -SCENARIO_BEGIN Forwarder and a timeout happens on server query. +SCENARIO_BEGIN Forwarder and an error happens on server query. STEP 1 QUERY ENTRY_BEGIN SECTION QUESTION