1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

resolved: don't bother caching negative RRs when the SOA TTL is 0 anyway

This commit is contained in:
Lennart Poettering 2014-08-01 00:57:19 +02:00
parent 7be6885326
commit 95dd6257a6

View File

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