Development discussion of WireGuard
 help / color / mirror / Atom feed
* Wireguard DKMS build on OpenVZ 7
@ 2021-02-08 20:05 Benedikt Braunger
  0 siblings, 0 replies; only message in thread
From: Benedikt Braunger @ 2021-02-08 20:05 UTC (permalink / raw)
  To: WireGuard mailing list

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@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@test ~ # yum update wireguard-dkms -y 

...

Updated:

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

Complete!

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

[17:34:03] root@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@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@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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-10 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 20:05 Wireguard DKMS build on OpenVZ 7 Benedikt Braunger

Development discussion of WireGuard

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ http://inbox.vuxu.org/wireguard \
		wireguard@lists.zx2c4.com
	public-inbox-index wireguard

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.wireguard


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git