mirror of
https://github.com/systemd/systemd.git
synced 2025-03-21 02:50:18 +03:00
resolved: cache - improve logging
Some DNS servers will hand out negative answers without SOA records, these can not be cached, so log about that fact.
This commit is contained in:
parent
71e136699c
commit
c3cb6dc20b
@ -443,8 +443,17 @@ int dns_cache_put(
|
||||
dns_cache_remove(c, key);
|
||||
}
|
||||
|
||||
if (!answer)
|
||||
if (!answer) {
|
||||
_cleanup_free_ char *key_str = NULL;
|
||||
|
||||
r = dns_resource_key_to_string(key, &key_str);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
log_debug("Not caching negative entry without a SOA record: %s", key_str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < answer->n_rrs; i++)
|
||||
dns_cache_remove(c, answer->items[i].rr->key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user