nicer error, random() improved.

git-svn-id: file:///svn/unbound/trunk@707 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2007-10-19 12:10:13 +00:00
parent 391504fd03
commit 90df76f931
3 changed files with 3 additions and 3 deletions
+2
View File
@@ -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)
+1
View File
@@ -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.
-3
View File
@@ -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);