summaryrefslogtreecommitdiff
path: root/util/data/msgencode.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2019-02-06 12:31:02 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2019-02-06 12:31:02 +0000
commit9c9d011eed674ddd7e4a0a148691887afb9e75cd (patch)
treecd45bceeed24e66e5b2838e8589d2c111cf691c6 /util/data/msgencode.c
parent089d83fbd0b24f957b753d440f188ddadaabf4ff (diff)
Diffstat (limited to 'util/data/msgencode.c')
-rw-r--r--util/data/msgencode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/data/msgencode.c b/util/data/msgencode.c
index 6bc3216ff9e9..4c0a5550be13 100644
--- a/util/data/msgencode.c
+++ b/util/data/msgencode.c
@@ -50,6 +50,11 @@
#include "sldns/sbuffer.h"
#include "services/localzone.h"
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#include <sys/time.h>
+
/** return code that means the function ran out of memory. negative so it does
* not conflict with DNS rcodes. */
#define RETVAL_OUTMEM -2
@@ -672,7 +677,7 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep,
}
/* roundrobin offset. using query id for random number. With ntohs
* for different roundrobins for sequential id client senders. */
- rr_offset = RRSET_ROUNDROBIN?ntohs(id):0;
+ rr_offset = RRSET_ROUNDROBIN?ntohs(id)+(timenow?timenow:time(NULL)):0;
/* "prepend" any local alias records in the answer section if this
* response is supposed to be authoritative. Currently it should