OpenVPN / ovpn-dco

OpenVPN Data Channel Offload in the linux kernel
108 stars 27 forks source link

Dirty fix for Compilation problems - Is this alright? #68

Closed tabletseeker closed 1 month ago

tabletseeker commented 1 month ago
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/main.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/bind.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/crypto.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/peer.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/sock.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/stats.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/netlink.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/crypto_aead.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/pktid.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/tcp.o
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/udp.o
  LD [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.o
  MODPOST /home/user/Downloads/ovpn-dco-0.2.20240712/Module.symvers
  CC [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.mod.o
  LD [M]  /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko
  BTF [M] /home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko

WARNING: Module.symvers is missing.
         Modules may not have dependencies or modversions.
         You may get many unresolved symbol errors.
         You can set KBUILD_MODPOST_WARN=1 to turn errors into warning
         if you want to proceed at your own risk.
ERROR: modpost: "timer_delete" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "crypto_alloc_aead" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "_raw_write_unlock_bh" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "netdev_warn" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "crypto_aead_setauthsize" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "timer_delete_sync" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "crypto_aead_decrypt" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "net_ratelimit" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "ip_route_output_flow" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "__netif_napi_del" [/home/user/Downloads/ovpn-dco-0.2.20240712/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
WARNING: modpost: suppressed 143 unresolved symbol warnings because there were too many)
make[3]: *** [scripts/Makefile.modpost:145: /home/user/Downloads/ovpn-dco-0.2.20240712/Module.symvers] Error 1
make[2]: *** [/home/user/linux/Makefile:1886: modpost] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/home/user/linux'
make: *** [Makefile:51: all] Error 2

Loading udp_tunnel modules via modprobe udp_tunnel ip6_udp_tunnel as described in #38 did not solve the issue.

Edit: The same error occurs when trying to insert the module in a kernel tree with make make KERNEL_SRC=/path/to/the/kernel/tree

sudo make -C /home/user/linux M=/home/user/Downloads/ovpn-dco-0.2.20240712 modules_install does not seem to include the module in the kernel tree, but on the local machine at /lib/modules...

make: Entering directory '/home/user/linux'
  INSTALL /lib/modules/6.10.5-dirty/updates/drivers/net/ovpn-dco/ovpn-dco-v2.ko
  SIGN    /lib/modules/6.10.5-dirty/updates/drivers/net/ovpn-dco/ovpn-dco-v2.ko
  XZ      /lib/modules/6.10.5-dirty/updates/drivers/net/ovpn-dco/ovpn-dco-v2.ko.xz
  DEPMOD  /lib/modules/6.10.5-dirty
make: Leaving directory '/home/user/linux'
tabletseeker commented 1 month ago

For anyone else building a kernel and trying to include this, the recommended method of adding the module didn't work for me, so I figured out another way. Not sure if that's the "correct way", but it seems to work.

Steps:

config WIREGUARD tristate "WireGuard secure network tunnel" depends on NET && INET depends on IPV6 || !IPV6 depends on !KMSAN # KMSAN doesn't support the crypto configs below select NET_UDP_TUNNEL select DST_CACHE select CRYPTO select CRYPTO_LIB_CURVE25519 select CRYPTO_LIB_CHACHA20POLY1305 select CRYPTO_CHACHA20_X86_64 if X86 && 64BIT select CRYPTO_POLY1305_X86_64 if X86 && 64BIT select CRYPTO_BLAKE2S_X86 if X86 && 64BIT select CRYPTO_CURVE25519_X86 if X86 && 64BIT select CRYPTO_CHACHA20_NEON if ARM || (ARM64 && KERNEL_MODE_NEON) select CRYPTO_POLY1305_NEON if ARM64 && KERNEL_MODE_NEON select CRYPTO_POLY1305_ARM if ARM select CRYPTO_BLAKE2S_ARM if ARM select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON select CRYPTO_CHACHA_MIPS if CPU_MIPS32_R2 select CRYPTO_POLY1305_MIPS if MIPS select CRYPTO_CHACHA_S390 if S390 help WireGuard is a secure, fast, and easy to use replacement for IPSec that uses modern cryptography and clever networking tricks. It's designed to be fairly general purpose and abstract enough to fit most use cases, while at the same time remaining extremely simple to configure. See www.wireguard.com for more info.


* run `make menuconfig` and configure dco as built-in or module