]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
stop using bogus lowestTime, thanks @mnordhoff 8334/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 23 Sep 2019 07:45:17 +0000 (09:45 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 23 Sep 2019 07:45:17 +0000 (09:45 +0200)
pdns/dnsscope.cc

index a31106e6cc1555d6c845ae0d91d755ccf83d2e1c..4723d8b215124d40e090ffe43249ca74e3245b36 100644 (file)
@@ -212,7 +212,7 @@ try
   typedef map<uint16_t,uint32_t> rcodes_t;
   rcodes_t rcodes;
   
-  time_t lowestTime=2000000000, highestTime=0;
+  time_t lowestTime=0, highestTime=0;
   time_t lastsec=0;
   LiveCounts lastcounts;
   std::unordered_set<ComboAddress, ComboAddress::addressOnlyHash> requestors, recipients, rdnonra;
@@ -290,7 +290,8 @@ try
            lastcounts = lc;
          }
 
-         lowestTime=min((time_t)lowestTime,  (time_t)pr.d_pheader.ts.tv_sec);
+    if(lowestTime) { lowestTime = min((time_t)lowestTime,  (time_t)pr.d_pheader.ts.tv_sec); }
+    else { lowestTime = pr.d_pheader.ts.tv_sec; }
          highestTime=max((time_t)highestTime, (time_t)pr.d_pheader.ts.tv_sec);
 
          QuestionIdentifier qi=QuestionIdentifier::create(pr.getSource(), pr.getDest(), header, qname, qtype);