summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-cache.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-01 00:55:51 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-01 00:58:12 +0200
commit9a015429b3bbfe1c2802570c1621e73d6cb57ac3 (patch)
treec4e11b139a4d6de41a40f2a97598e5f1967a262f /src/resolve/resolved-dns-cache.c
parent7da40fc10879d122cc6ebfba9609b56212a0ef77 (diff)
resolved: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC when aging caches and timeing out transactions
That way the cache doens't get confused when the system is suspended.
Diffstat (limited to 'src/resolve/resolved-dns-cache.c')
-rw-r--r--src/resolve/resolved-dns-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
index 7359dfa271..f7091f07bf 100644
--- a/src/resolve/resolved-dns-cache.c
+++ b/src/resolve/resolved-dns-cache.c
@@ -153,7 +153,7 @@ void dns_cache_prune(DnsCache *c) {
break;
if (t <= 0)
- t = now(CLOCK_MONOTONIC);
+ t = now(CLOCK_BOOTTIME);
if (i->until > t)
break;
@@ -376,7 +376,7 @@ int dns_cache_put(DnsCache *c, DnsQuestion *q, int rcode, DnsAnswer *answer, uns
dns_cache_make_space(c, answer->n_rrs + q->n_keys);
if (timestamp <= 0)
- timestamp = now(CLOCK_MONOTONIC);
+ timestamp = now(CLOCK_BOOTTIME);
/* Second, add in positive entries for all contained RRs */
for (i = 0; i < MIN(max_rrs, answer->n_rrs); i++) {