From: Remi Gacogne Date: Fri, 30 Sep 2016 16:41:04 +0000 (+0200) Subject: dnsdist: Don't mix "real" and monotonic time for TCP queries X-Git-Tag: dnsdist-1.1.0-beta2~58^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=614bfa37ebf86560330357bdb7cccbbf3464ed94;p=thirdparty%2Fpdns.git dnsdist: Don't mix "real" and monotonic time for TCP queries Otherwise the time stored in the response ring makes no sense. --- diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 5a8f774bf5..f3719d6c51 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -265,8 +265,11 @@ void* tcpClientThread(int pipefd) string poolname; int delayMsec=0; + /* we need this one to be accurate ("real") for the protobuf message */ + struct timespec queryRealTime; struct timespec now; - gettime(&now, true); + gettime(&now); + gettime(&queryRealTime, true); if (!processQuery(localDynBlockNMG, localDynBlockSMT, localRulactions, blockFilter, dq, poolname, &delayMsec, now)) { goto drop; @@ -433,7 +436,7 @@ void* tcpClientThread(int pipefd) } dh = (struct dnsheader*) response; - DNSResponse dr(&qname, qtype, qclass, &ci.cs->local, &ci.remote, dh, responseSize, responseLen, true, &now); + DNSResponse dr(&qname, qtype, qclass, &ci.cs->local, &ci.remote, dh, responseSize, responseLen, true, &queryRealTime); #ifdef HAVE_PROTOBUF dr.uniqueId = dq.uniqueId; #endif