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: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3995%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix comparison between signed and unsigned integer --- diff --git a/pdns/dnsdist-cache.cc b/pdns/dnsdist-cache.cc index 3c8b1d2eb4..3e085bd7d9 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; }