projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23502de
)
resolved: flush keys when DNS_RESOURCE_KEY_CACHE_FLUSH is set
author
Daniel Mack
<daniel@zonque.org>
Tue, 4 Aug 2015 12:12:46 +0000
(14:12 +0200)
committer
Daniel Mack
<daniel@zonque.org>
Tue, 8 Dec 2015 15:51:39 +0000
(16:51 +0100)
In mDNS, DNS_RESOURCE_KEY_CACHE_FLUSH denotes whether other records with the
same key should be flushed from the cache.
src/resolve/resolved-dns-cache.c
patch
|
blob
|
history
diff --git
a/src/resolve/resolved-dns-cache.c
b/src/resolve/resolved-dns-cache.c
index
bcb9994
..
2179a61
100644
(file)
--- a/
src/resolve/resolved-dns-cache.c
+++ b/
src/resolve/resolved-dns-cache.c
@@
-459,7
+459,12
@@
int dns_cache_put(
/* Second, add in positive entries for all contained RRs */
for (i = 0; i < MIN(max_rrs, answer->n_rrs); i++) {
- r = dns_cache_put_positive(c, answer->items[i].rr, authenticated, timestamp, owner_family, owner_address);
+ DnsResourceRecord *rr = answer->items[i].rr;
+
+ if (rr->key->cache_flush)
+ dns_cache_remove(c, rr->key);
+
+ r = dns_cache_put_positive(c, rr, authenticated, timestamp, owner_family, owner_address);
if (r < 0)
goto fail;
}