From 90df76f931eb4c1407449e5d5ca93a35f09594ec Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Fri, 19 Oct 2007 12:10:13 +0000 Subject: [PATCH] nicer error, random() improved. git-svn-id: file:///svn/unbound/trunk@707 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/daemon.c | 2 ++ doc/Changelog | 1 + services/outside_network.c | 3 --- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/daemon.c b/daemon/daemon.c index 5447e9f29..c585ef0e3 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -68,6 +68,8 @@ static int sig_record_reload = 0; static RETSIGTYPE record_sigh(int sig) { #ifdef LIBEVENT_SIGNAL_PROBLEM + verbose(VERB_OPS, "quit on signal, no cleanup and statistics, " + "because installed libevent version is not threadsafe"); exit(0); #endif switch(sig) diff --git a/doc/Changelog b/doc/Changelog index e2ee3b98b..e9e8ac17e 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -11,6 +11,7 @@ - ldns-src configure is done during unbound configure and ldns-src make is done during unbound make, and so inherits the make arguments from the unbound make invocation. + - nicer error when libevent problem causes instant exit on signal. 18 October 2007: Wouter - addresses are logged with errors. diff --git a/services/outside_network.c b/services/outside_network.c index 867f94411..4ccce3cde 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -603,7 +603,6 @@ new_pending(struct outside_network* outnet, ldns_buffer* packet, return NULL; } /* set */ - /* id uses lousy random() TODO use better and entropy */ pend->id = ((unsigned)ub_random(rnd)>>8) & 0xffff; LDNS_ID_SET(ldns_buffer_begin(packet), pend->id); memcpy(&pend->addr, addr, addrlen); @@ -655,7 +654,6 @@ select_port(struct outside_network* outnet, struct pending* pend, } /* choose a random outgoing port and interface */ - /* TODO: entropy source. */ precho = (double)ub_random(rnd) * (double)nummax / ((double)RAND_MAX + 1.0); chosen = (int)precho; @@ -765,7 +763,6 @@ pending_tcp_query(struct outside_network* outnet, ldns_buffer* packet, } w->pkt = NULL; w->pkt_len = 0; - /* id uses lousy random() TODO use better and entropy */ id = ((unsigned)ub_random(rnd)>>8) & 0xffff; LDNS_ID_SET(ldns_buffer_begin(packet), id); memcpy(&w->addr, addr, addrlen); -- 2.47.2