View | Details | Raw Unified | Return to bug 208725 | Differences between
and this patch

Collapse All | Expand All

(-)dns/powerdns/files/patch-pdns__dnspacket.cc (+14 lines)
Line 0 Link Here
1
--- pdns/dnspacket.cc.orig	2015-11-02 11:33:21.000000000 +0100
2
+++ pdns/dnspacket.cc	2016-04-11 16:12:10.116338000 +0200
3
@@ -642,8 +642,9 @@ bool checkForCorrectTSIG(const DNSPacket
4
 
5
   q->getTSIGDetails(trc, keyname, &message);
6
   uint64_t now = time(0);
7
-  if(abs(trc->d_time - now) > trc->d_fudge) {
8
-    L<<Logger::Error<<"Packet for '"<<q->qdomain<<"' denied: TSIG (key '"<<*keyname<<"') time delta "<< abs(trc->d_time - now)<<" > 'fudge' "<<trc->d_fudge<<endl;
9
+  uint64_t diff = trc->d_time >= now ? trc->d_time - now : now - trc->d_time;
10
+  if(diff > trc->d_fudge) {
11
+    L<<Logger::Error<<"Packet for '"<<q->qdomain<<"' denied: TSIG (key '"<<*keyname<<"') time delta "<<diff<<" > 'fudge' "<<trc->d_fudge<<endl;
12
     return false;
13
   }
14
 

Return to bug 208725