diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-17 04:55:11 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-17 04:58:43 +0100 |
commit | b308a48cab8d28b27df128bd70c49b3f30931d2f (patch) | |
tree | 2107ce6aa75af21256e3fba2cb90b9b540e4228b | |
parent | compat: ipv6_stub is sometimes null (diff) | |
download | wireguard-monolithic-historical-b308a48cab8d28b27df128bd70c49b3f30931d2f.tar.xz wireguard-monolithic-historical-b308a48cab8d28b27df128bd70c49b3f30931d2f.zip |
compat: backport ALIGN_DOWN
-rw-r--r-- | src/compat/compat.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index ae3189f..e08edca 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -766,6 +766,13 @@ struct __kernel_timespec { #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) +#include <linux/kernel.h> +#ifndef ALIGN_DOWN +#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a)) +#endif +#endif + /* https://github.com/ClangBuiltLinux/linux/issues/7 */ #if defined( __clang__) && (!defined(CONFIG_CLANG_VERSION) || CONFIG_CLANG_VERSION < 80000) #include <linux/bug.h> |