]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix signed/unsigned type confusion warnings in checkForCorrectTSIG 2918/head
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Sun, 22 Nov 2015 22:19:20 +0000 (23:19 +0100)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Sun, 22 Nov 2015 22:19:20 +0000 (23:19 +0100)
pdns/dnspacket.cc

index 7a21eebffe9d609468e4551e1c7c123006eaded2..1c330446ae4c58c90d42c656db914c766cadce4e 100644 (file)
@@ -656,9 +656,9 @@ bool checkForCorrectTSIG(const DNSPacket* q, UeberBackend* B, DNSName* keyname,
   string message;
 
   q->getTSIGDetails(trc, keyname, &message);
-  int64_t now = time(0);
-  if(abs((int64_t)trc->d_time - now) > trc->d_fudge) {
-    L<<Logger::Error<<"Packet for '"<<q->qdomain<<"' denied: TSIG (key '"<<*keyname<<"') time delta "<< abs(trc->d_time - now)<<" > 'fudge' "<<trc->d_fudge<<endl;
+  uint64_t delta = std::abs((int64_t)trc->d_time - (int64_t)time(0));
+  if(delta > trc->d_fudge) {
+    L<<Logger::Error<<"Packet for '"<<q->qdomain<<"' denied: TSIG (key '"<<*keyname<<"') time delta "<< delta <<" > 'fudge' "<<trc->d_fudge<<endl;
     return false;
   }