From 9a800999486939eaa74f155f30d75be652bf9bc3 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 11 Apr 2025 15:48:27 +0200 Subject: [PATCH] dnsdist: Update outdated comment, as suggested by Miod (thanks!) --- pdns/dnsdistdist/dnsdist-cache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdistdist/dnsdist-cache.cc b/pdns/dnsdistdist/dnsdist-cache.cc index 6aeee8a3ab..6d9e1fc3e1 100644 --- a/pdns/dnsdistdist/dnsdist-cache.cc +++ b/pdns/dnsdistdist/dnsdist-cache.cc @@ -149,8 +149,10 @@ void DNSDistPacketCache::insert(uint32_t key, const boost::optional& su // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) minTTL = getMinTTL(reinterpret_cast(response.data()), response.size(), &seenAuthSOA); - /* no TTL found, we don't want to cache this */ if (minTTL == std::numeric_limits::max()) { + /* no TTL found, we probably don't want to cache this + unless it's an empty (no records) truncated answer, + and we have been asked to cache these */ if (d_settings.d_truncatedTTL == 0) { return; } -- 2.47.2