diff options
author | Jorge Niedbalski <jnr@metaklass.org> | 2019-07-12 15:34:24 -0400 |
---|---|---|
committer | Jorge Niedbalski <jnr@metaklass.org> | 2019-07-17 10:42:53 -0400 |
commit | 37d7a7d984ec7679711c2d31789f033f3b6dc2c2 (patch) | |
tree | f4fb302ef3b0aa7d51e2e50e4ec4cc6444b53231 /src/resolve/resolved-mdns.c | |
parent | 81c07a955590b44fe2b1f21780df353c0d8b62f6 (diff) | |
download | systemd-37d7a7d984ec7679711c2d31789f033f3b6dc2c2.tar.gz |
resolved: switch cache option to a tri-state option (systemd#5552).
Change the resolved.conf Cache option to a tri-state "no, no-negative, yes" values.
If a lookup returns SERVFAIL systemd-resolved will cache the result for 30s (See 201d995),
however, there are several use cases on which this condition is not acceptable (See systemd#5552 comments)
and the only workaround would be to disable cache entirely or flush it , which isn't optimal.
This change adds the 'no-negative' option when set it avoids putting in cache
negative answers but still works the same heuristics for positive answers.
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
Diffstat (limited to 'src/resolve/resolved-mdns.c')
-rw-r--r-- | src/resolve/resolved-mdns.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/resolved-mdns.c b/src/resolve/resolved-mdns.c index 67080cb01c..eba2978991 100644 --- a/src/resolve/resolved-mdns.c +++ b/src/resolve/resolved-mdns.c @@ -319,7 +319,7 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us dns_transaction_process_reply(t, p); } - dns_cache_put(&scope->cache, NULL, DNS_PACKET_RCODE(p), p->answer, false, (uint32_t) -1, 0, p->family, &p->sender); + dns_cache_put(&scope->cache, scope->manager->enable_cache, NULL, DNS_PACKET_RCODE(p), p->answer, false, (uint32_t) -1, 0, p->family, &p->sender); } else if (dns_packet_validate_query(p) > 0) { log_debug("Got mDNS query packet for id %u", DNS_PACKET_ID(p)); |