summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-01 00:57:19 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-01 00:58:13 +0200
commit95dd6257a6befedb5b811f16d2cc4a0d8f147751 (patch)
tree11070721f364bb423c59e340c77940a958b855c5 /src
parent7be6885326d8316850062a5002c801102496d3bc (diff)
resolved: don't bother caching negative RRs when the SOA TTL is 0 anyway
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-dns-cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
index f7091f07bf..40fb6c3984 100644
--- a/src/resolve/resolved-dns-cache.c
+++ b/src/resolve/resolved-dns-cache.c
@@ -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;