summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-query.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-query.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-query.c')
-rw-r--r--src/resolve/resolved-dns-query.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c
index 57f7467667..36cfc026ea 100644
--- a/src/resolve/resolved-dns-query.c
+++ b/src/resolve/resolved-dns-query.c
@@ -278,7 +278,12 @@ int dns_query_go(DnsQuery *q) {
q->answer_ifindex = 0;
q->answer_rcode = 0;
- r = sd_event_add_time(q->manager->event, &q->timeout_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + QUERY_TIMEOUT_USEC, 0, on_query_timeout, q);
+ r = sd_event_add_time(
+ q->manager->event,
+ &q->timeout_event_source,
+ clock_boottime_or_monotonic(),
+ now(clock_boottime_or_monotonic()) + QUERY_TIMEOUT_USEC, 0,
+ on_query_timeout, q);
if (r < 0)
goto fail;