From: Remi Gacogne Date: Tue, 14 Jun 2016 15:09:09 +0000 (+0200) Subject: dnsdist: Fix comparison between signed and unsigned integer X-Git-Tag: auth-4.0.0-rc1~41^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1a0a75ab2bb1f0fdbd3ee5539109743563587c2;p=pdns dnsdist: Fix comparison between signed and unsigned integer --- diff --git a/pdns/dnsdist-cache.cc b/pdns/dnsdist-cache.cc index 3c8b1d2eb..3e085bd7d 100644 --- a/pdns/dnsdist-cache.cc +++ b/pdns/dnsdist-cache.cc @@ -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(allowExpired)) { d_misses++; return false; }