mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-10-01 06:04:55 +02:00
nicer error, random() improved.
git-svn-id: file:///svn/unbound/trunk@707 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user