diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-29 02:02:31 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-29 02:02:31 +0100 |
commit | 9639e7219e69533fd92022c345869bf8e8c202ff (patch) | |
tree | f6c8a8206ed8cd408970bf92c2c106b0c5570565 /src/compat | |
parent | 36f81c83674e0fd7c18e5b15499d1a275b6d4d7f (diff) |
compat: fix 3.10 backport
For archs that do not provide the magic csum function, we need to
provide the generic function. Also, some obscure 3.10s have backported
the int size macros, so we ifndef around that to avoid potentially fatal
warnings.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat')
-rw-r--r-- | src/compat/checksum/checksum_partial_compat.h | 2 | ||||
-rw-r--r-- | src/compat/compat.h | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/compat/checksum/checksum_partial_compat.h b/src/compat/checksum/checksum_partial_compat.h index 5175d84..147b0a6 100644 --- a/src/compat/checksum/checksum_partial_compat.h +++ b/src/compat/checksum/checksum_partial_compat.h @@ -2,6 +2,8 @@ #include <net/esp.h> #include <net/ip.h> #include <net/ipv6.h> +#include <net/ip6_checksum.h> + #define IP6_MF 0x0001 #define IP6_OFFSET 0xFFF8 static inline int skb_maybe_pull_tail(struct sk_buff *skb, unsigned int len, unsigned int max) diff --git a/src/compat/compat.h b/src/compat/compat.h index 16e7923..042e987 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -215,19 +215,43 @@ static inline u32 prandom_u32_max(u32 ep_ro) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 75) && !defined(ISRHEL7) +#ifndef U8_MAX #define U8_MAX ((u8)~0U) +#endif +#ifndef S8_MAX #define S8_MAX ((s8)(U8_MAX >> 1)) +#endif +#ifndef S8_MIN #define S8_MIN ((s8)(-S8_MAX - 1)) +#endif +#ifndef U16_MAX #define U16_MAX ((u16)~0U) +#endif +#ifndef S16_MAX #define S16_MAX ((s16)(U16_MAX >> 1)) +#endif +#ifndef S16_MIN #define S16_MIN ((s16)(-S16_MAX - 1)) +#endif +#ifndef U32_MAX #define U32_MAX ((u32)~0U) +#endif +#ifndef S32_MAX #define S32_MAX ((s32)(U32_MAX >> 1)) +#endif +#ifndef S32_MIN #define S32_MIN ((s32)(-S32_MAX - 1)) +#endif +#ifndef U64_MAX #define U64_MAX ((u64)~0ULL) +#endif +#ifndef S64_MAX #define S64_MAX ((s64)(U64_MAX >> 1)) +#endif +#ifndef S64_MIN #define S64_MIN ((s64)(-S64_MAX - 1)) #endif +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 60) && !defined(ISRHEL7) /* Making this static may very well invalidate its usefulness, |