Wireguard DKMS build on OpenVZ 7

Benedikt Braunger b.braunger at syseleven.de
Mon Feb 8 20:05:30 UTC 2021


Hello Tunnelerz,

Again I'm having trouble to compile the newest Wireguard DKMS module for
the wonderfully frankensteined OpenVZ / Virtuozzo 7 kernel.

The problem occures when updating the wireguard-dkms package

[17:32:10] root at test ~ # uname -a
Linux test 3.10.0-1127.18.2.vz7.163.46 #1 SMP Fri Nov 20 21:47:55 MSK 2020 x86_64 x86_64 x86_64 GNU/Linux
[17:32:11] root at test ~ # yum update wireguard-dkms -y 

...

Updated:

  wireguard-dkms.noarch 1:1.0.20210124-1.el7                                                                                                                                    

Complete!

[17:34:02] root at test ~ # dkms status
wireguard, 1.0.20210124: added

[17:34:03] root at test ~ # dkms autoinstall 
Kernel preparation unnecessary for this kernel.  Skipping...

Building module:

cleaning build area...

make -j48 KERNELRELEASE=3.10.0-1127.18.2.vz7.163.46 -C /lib/modules/3.10.0-1127.18.2.vz7.163.46/build M=/var/lib/dkms/wireguard/1.0.20210124/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 3.10.0-1127.18.2.vz7.163.46 (x86_64)
Consult /var/lib/dkms/wireguard/1.0.20210124/build/make.log for more information.

[17:34:14] root at test ~ # tail /var/lib/dkms/wireguard/1.0.20210124/build/make.log
  AS [M]  /var/lib/dkms/wireguard/1.0.20210124/build/crypto/zinc/chacha20/chacha20-x86_64.o
/var/lib/dkms/wireguard/1.0.20210124/build/crypto/zinc/chacha20/chacha20-x86_64.o: warning: objtool: chacha20_avx512vl()+0x35: can't find jump dest instruction at .text+0x1f3f
/var/lib/dkms/wireguard/1.0.20210124/build/socket.c: In function ‘send6’:
/var/lib/dkms/wireguard/1.0.20210124/build/socket.c:139:18: error: ‘const struct ipv6_stub’ has no member named ‘ipv6_dst_lookup_flow’
   dst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(sock), sock, &fl,
                  ^

make[1]: *** [/var/lib/dkms/wireguard/1.0.20210124/build/socket.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [_module_/var/lib/dkms/wireguard/1.0.20210124/build] Error 2
make: Leaving directory `/usr/src/kernels/3.10.0-1127.18.2.vz7.163.46'

As far as I understand this comes from the fact that
"ipv6_dst_lookup_flo" is not available in some kernels but is in others
and obviously it is used wrong here.

So I fixed this using the following workaround:

export VERSION='1.0.20210124';
yum install -y wireguard-dkms;
echo '#define ipv6_dst_lookup_flow(a, b, c, d) ipv6_dst_lookup(a, b, &dst, c) + (void *)0 ?: dst' >> /usr/src/wireguard-$VERSION/compat/compat.h;
dkms build wireguard/$VERSION && dkms install wireguard/$VERSION;
modprobe wireguard

[17:43:17] root at test~ # dkms status
wireguard, 1.0.20210124, 3.10.0-1127.18.2.vz7.163.46, x86_64: installed

I think the culprit is in
https://git.zx2c4.com/wireguard-linux-compat/tree/src/compat/compat.h#n92
and following

These conditions do not match for the OpenVZ systems as they have a
3.10.0 kernel and are RHEL based. I suggest an additional check like

 (LINUX_VERSION_CODE = KERNEL_VERSION(3, 10, 0) && defined(ISRHEL7))

but I am not sure if this could interfere with older RHEL versions.

Feedback or good ideas very welcome :-)

Regards,
Beni



More information about the WireGuard mailing list