From a1a0a75ab2bb1f0fdbd3ee5539109743563587c2 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 14 Jun 2016 17:09:09 +0200 Subject: [PATCH] dnsdist: Fix comparison between signed and unsigned integer --- pdns/dnsdist-cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.40.0