aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/timers.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-12 15:05:50 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-25 16:42:42 +0200
commit868bdd798190a689ddebf1fff7c41509e73c7cc0 (patch)
treeeda7b6e3f06ea2e5ae20c175944a433231681b4c /src/timers.h
parentcompat: unify custom function prefix/suffix (diff)
downloadwireguard-linux-compat-868bdd798190a689ddebf1fff7c41509e73c7cc0.tar.xz
wireguard-linux-compat-868bdd798190a689ddebf1fff7c41509e73c7cc0.zip
global: switch to coarse ktime
Coarse ktime is broken until [1] in 5.2 and kernels without the backport, so we use fallback code there. The fallback code has also been improved significantly. It now only uses slower clocks on kernels < 3.17, at the expense of some accuracy we're not overly concerned about. [1] https://lore.kernel.org/lkml/tip-e3ff9c3678b4d80e22d2557b68726174578eaf52@git.kernel.org/ Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.h')
-rw-r--r--src/timers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timers.h b/src/timers.h
index f9d11fe..f0653dc 100644
--- a/src/timers.h
+++ b/src/timers.h
@@ -25,7 +25,7 @@ static inline bool wg_birthdate_has_expired(u64 birthday_nanoseconds,
u64 expiration_seconds)
{
return (s64)(birthday_nanoseconds + expiration_seconds * NSEC_PER_SEC)
- <= (s64)ktime_get_boot_fast_ns();
+ <= (s64)ktime_get_coarse_boottime_ns();
}
#endif /* _WG_TIMERS_H */