pdns/dnspacket.cc patch

a b <[email protected]>
Newsgroups gmane.network.dns.powerdns.devel
Message-ID <[email protected]>
This patch fixes the compile error reported earlier with GCC 4.7.1. If someone with more insight could review it and provide feedback, it would be much appreciated. In the patch I replaced uint64_t with long because that is labs(3C) calls for in the prototype. However, I am not sure that this is correct. Presumably, with uint64_t the intent was much finer time granularity?

--- pdns/dnspacket.cc.orig      Wed Oct  2 13:57:59 2013
+++ pdns/dnspacket.cc   Wed Oct  2 19:28:46 2013
@@ -572,9 +572,9 @@
   string message;
   
   q->getTSIGDetails(trc, keyname, &message);
-  uint64_t now = time(0);
-  if(abs(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;
+  long now = (long)time(0);
+  if(labs((long)trc->d_time - now)> (long)trc->d_fudge) {
+    L<<Logger::Error<<"Packet for '"<<q->qdomain<<"' denied: TSIG (key '"<<*keyname<<"') time delta "<< (long)labs((long)trc->d_time - now)<<"> 'fudge' "<<
trc->d_fudge<<endl;
     return false;
   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.