From 9a015429b3bbfe1c2802570c1621e73d6cb57ac3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 1 Aug 2014 00:55:51 +0200 Subject: 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. --- src/resolve/resolved-dns-transaction.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/resolve/resolved-dns-transaction.c') diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 92f7e4c5b1..faa1de9143 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -515,7 +515,12 @@ int dns_transaction_go(DnsTransaction *t) { return dns_transaction_go(t); } - r = sd_event_add_time(t->scope->manager->event, &t->timeout_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + TRANSACTION_TIMEOUT_USEC(t->scope->protocol), 0, on_transaction_timeout, t); + r = sd_event_add_time( + t->scope->manager->event, + &t->timeout_event_source, + clock_boottime_or_monotonic(), + now(clock_boottime_or_monotonic()) + TRANSACTION_TIMEOUT_USEC(t->scope->protocol), 0, + on_transaction_timeout, t); if (r < 0) return r; -- cgit v1.2.3-54-g00ecf