chiark / gitweb /
resolved: don't bother caching negative RRs when the SOA TTL is 0 anyway
authorLennart Poettering <lennart@poettering.net>
Thu, 31 Jul 2014 22:57:19 +0000 (00:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 31 Jul 2014 22:58:13 +0000 (00:58 +0200)
src/resolve/resolved-dns-cache.c

index f7091f07bf4b5c18e1ba949ca6bd4a4fed548f32..40fb6c39844c484ef0888978c55167dd0142670f 100644 (file)
@@ -320,6 +320,8 @@ static int dns_cache_put_negative(DnsCache *c, DnsResourceKey *key, int rcode, u
                 return 0;
         if (key->type == DNS_TYPE_ANY)
                 return 0;
+        if (soa_ttl <= 0)
+                return 0;
 
         if (!IN_SET(rcode, DNS_RCODE_SUCCESS, DNS_RCODE_NXDOMAIN))
                 return 0;