Skip to content

Commit

Permalink
Fix signed/unsigned type confusion warnings in checkForCorrectTSIG
Browse files Browse the repository at this point in the history
  • Loading branch information
zeha committed Nov 22, 2015
1 parent cff3e04 commit f2d05dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pdns/dnspacket.cc
Expand Up @@ -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;
}

Expand Down

0 comments on commit f2d05dd

Please sign in to comment.