From f4c9c08fb4a558d880d183b65a12de3770c3860b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 4 Jun 2016 16:31:10 +0100 Subject: [PATCH] server/: Rename `TIMER' to `QUICKRAND'. The purpose of the `TIMER' is to feed the entropy a small quantity of entropy on a regular basis. Encoding the implementation in the name was an error which this commit fixes. --- server/admin.c | 4 ++-- server/peer.c | 4 ++-- server/tripe.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/admin.c b/server/admin.c index b25e511e..3257c7da 100644 --- a/server/admin.c +++ b/server/admin.c @@ -1013,7 +1013,7 @@ static void a_resolved(struct hostent *h, void *v) admin_resop *r = v; T( trace(T_ADMIN, "admin: resop %s resolved", BGTAG(r)); ) - TIMER; + QUICKRAND; if (!h) { a_bgfail(&r->bg, "resolve-error", "%s", r->addr, A_END); r->func(r, ARES_FAIL); @@ -2155,7 +2155,7 @@ static void a_line(char *p, size_t len, void *vp) char *av[16 + 1]; size_t ac; - TIMER; + QUICKRAND; if (a->f & AF_DEAD) return; if (!p) { diff --git a/server/peer.c b/server/peer.c index 06dd33db..57891e7b 100644 --- a/server/peer.c +++ b/server/peer.c @@ -313,7 +313,7 @@ static void p_read(int fd, unsigned mode, void *v) /* --- Read the data --- */ - TIMER; + QUICKRAND; sz = sizeof(addr); n = recvfrom(fd, buf_i, sizeof(buf_i), 0, &a.sa, &sz); if (n < 0) { @@ -658,7 +658,7 @@ void p_tun(peer *p, buf *b) { buf *bb = p_txstart(p, MSG_PACKET); - TIMER; + QUICKRAND; p_encrypt(p, MSG_PACKET, b, bb); if (BOK(bb) && BLEN(bb)) { p->st.n_ipout++; diff --git a/server/tripe.h b/server/tripe.h index d419c287..9e298c80 100644 --- a/server/tripe.h +++ b/server/tripe.h @@ -576,7 +576,7 @@ extern unsigned tr_flags; /* Trace options flags */ /*----- Other macros ------------------------------------------------------*/ -#define TIMER noise_timer(RAND_GLOBAL) +#define QUICKRAND noise_timer(RAND_GLOBAL) /*----- Key management ----------------------------------------------------*/ -- 2.11.0