From c870c7af53f44a37814dfc76ceb8ad88e290fcd8 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 22 Jan 2019 13:38:52 +0100 Subject: netlink: use __kernel_timespec for handshake time --- src/compat/compat.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/compat/compat.h') diff --git a/src/compat/compat.h b/src/compat/compat.h index 15cf8bb..19dd71a 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -748,10 +748,24 @@ static inline void crypto_xor_cpy(u8 *dst, const u8 *src1, const u8 *src2, #define hlist_add_behind(a, b) hlist_add_after(b, a) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) #define totalram_pages() totalram_pages #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) +struct __kernel_timespec { + int64_t tv_sec, tv_nsec; +}; +#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) +#include +#ifdef __kernel_timespec +#undef __kernel_timespec +struct __kernel_timespec { + int64_t tv_sec, tv_nsec; +}; +#endif +#endif + /* https://github.com/ClangBuiltLinux/linux/issues/7 */ #if defined( __clang__) && (!defined(CONFIG_CLANG_VERSION) || CONFIG_CLANG_VERSION < 80000) #include -- cgit v1.2.3-59-g8ed1b