]> granicus.if.org Git - pdns/commitdiff
dnsdist: Don't cache ServFail / Refused if the TTL is set to 0
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 15 Feb 2017 08:30:00 +0000 (09:30 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 15 Feb 2017 08:30:00 +0000 (09:30 +0100)
pdns/dnsdist-cache.cc

index ec3358795fa7a360e1f7898399e1f58dfb92ca35..75ae261df3e070c0f4e5b22806c04a68cd40982c 100644 (file)
@@ -53,6 +53,9 @@ void DNSDistPacketCache::insert(uint32_t key, const DNSName& qname, uint16_t qty
 
   if (rcode == RCode::ServFail || rcode == RCode::Refused) {
     minTTL = d_tempFailureTTL;
+    if (minTTL == 0) {
+      return;
+    }
   }
   else {
     minTTL = getMinTTL(response, responseLen);