]> granicus.if.org Git - pdns/commitdiff
dnsdist: Fix comparison between signed and unsigned integer
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 Jun 2016 15:09:09 +0000 (17:09 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 Jun 2016 15:09:09 +0000 (17:09 +0200)
pdns/dnsdist-cache.cc

index 3c8b1d2eb4454b0aea28f9a83b9ecb39bb37a058..3e085bd7d9ef27eebfb317577e08d1253f829ba4 100644 (file)
@@ -126,7 +126,7 @@ bool DNSDistPacketCache::get(const DNSQuestion& dq, uint16_t consumed, uint16_t
 
     const CacheValue& value = it->second;
     if (value.validity < now) {
-      if ((value.validity + allowExpired) < now) {
+      if ((now - value.validity) >= static_cast<time_t>(allowExpired)) {
         d_misses++;
         return false;
       }