aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-06-23 19:02:18 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-23 19:12:51 +0200
commit68441fb05412baebbd17f407bf984ad7a81af630 (patch)
tree71fefcc3710232dea912be362cb83f383720edc0 /src/compat/compat.h
parentglobal: use ktime boottime instead of jiffies (diff)
downloadwireguard-monolithic-historical-68441fb05412baebbd17f407bf984ad7a81af630.tar.xz
wireguard-monolithic-historical-68441fb05412baebbd17f407bf984ad7a81af630.zip
global: use fast boottime instead of normal boottime
Generally if we're inaccurate by a few nanoseconds, it doesn't matter.
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r--src/compat/compat.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index d0efdb9..d08557f 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -334,11 +334,11 @@ static inline u64 ktime_get_boot_ns(void)
}
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) && !defined(ISRHEL7)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
#include <linux/ktime.h>
-static inline bool ktime_after(const ktime_t cmp1, const ktime_t cmp2)
+static inline u64 ktime_get_boot_fast_ns(void)
{
- return ktime_compare(cmp1, cmp2) > 0;
+ return ktime_get_boot_ns();
}
#endif