[PATCH] added ipv6_dst_lookup_flow define for VZ7 kernels

Benedikt Braunger b.braunger at syseleven.de
Wed Mar 17 12:36:25 UTC 2021


Hi,

Is anything blocking this from getting merged into wireguard-compat?

Regards,
Beni

On 3/4/21 7:30 PM, Benedikt Braunger wrote:
> This patch adds an additional check for OpenVZ / Virtuozzo 7 custom
> kernels to ensure ipv6_dst_lookup_flow is defined.
> It also splits the very long version checking into multiple lines for
> better reading.
>
> Signed-off-by: Benedikt Braunger <b.braunger at syseleven.de>
> ---
> Since the error mentioned in "Wireguard DKMS build on OpenVZ 7" still
> occures, I searched for a way to check if the module is compiled on 
> a VZ kernel. This patch works for me, I tested on Virtuozzo 7 and 
> plain CentOS 7. Can compile on both without error and the module is
> loadable.
> Probably Virtuozzo will backuport ipv6_dst_lookup_flow some day but
> they can't (or don't want to) tell me when.
> If so one can compare VZVERSION to the current one to ensure the definition
> for older verions.
>
>  src/compat/compat.h | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/compat/compat.h b/src/compat/compat.h
> index 3e8e005..7700e7b 100644
> --- a/src/compat/compat.h
> +++ b/src/compat/compat.h
> @@ -91,7 +91,13 @@
>  
>  #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 83)
>  #define ipv6_dst_lookup_flow(a, b, c, d) ipv6_dst_lookup_flow(b, c, d)
> -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 5) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 18) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) && !defined(ISUBUNTU1904)) || (!defined(ISRHEL8) && !defined(ISDEBIAN) && !defined(ISUBUNTU1804) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 119) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 181) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 224) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 224) && !defined(ISUBUNTU1604) && !defined(ISRHEL7))
> +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 5) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))\
> +  || (LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 18) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) && !defined(ISUBUNTU1904))\
> +  || (!defined(ISRHEL8) && !defined(ISDEBIAN) && !defined(ISUBUNTU1804) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 119) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))\
> +  || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 181) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))\
> +  || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 224) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0))\
> +  || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 224) && !defined(ISUBUNTU1604) && !defined(ISRHEL7))\
> +  || (LINUX_VERSION_CODE == KERNEL_VERSION(3, 10, 0) && defined(ISRHEL7) && defined(VZVERSION))
>  #define ipv6_dst_lookup_flow(a, b, c, d) ipv6_dst_lookup(a, b, &dst, c) + (void *)0 ?: dst
>  #endif
>  


More information about the WireGuard mailing list