OpenVPN / ovpn-dco

OpenVPN Data Channel Offload in the linux kernel
106 stars 26 forks source link

dkms: autoinstall for kernel: 6.5.0-rc5 failed! #42

Closed xevilstar closed 1 year ago

xevilstar commented 1 year ago

Dear Maintainers,

here is the fixed header with it the code compiles smoothly

linux-compat.h.gz

Sadly the ovpn modules fails to compile under kernel 6.5-rc5

proposed fix

https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1919159.html

Followup-For: Bug #1043116
Control: tag -1 sid trixie

The fix may be as simple as adding

        #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
        #include <net/gso.h>
        #endif

somewhere.
That's all I had to do for fixing r8168-dkms which had the same error.

Andreas

CC [M] /usr/src/ovpn-dco-0.0+git20230324/drivers/net/ovpn-dco/ovpn.o /usr/src/ovpn-dco-0.0+git20230324/drivers/net/ovpn-dco/ovpn.c: In function 'ovpn_net_xmit': /usr/src/ovpn-dco-0.0+git20230324/drivers/net/ovpn-dco/ovpn.c:432:28: error: implicit declaration of function 'skb_gso_segment'; did you mean 'skb_gso_reset'? [-Werror=implicit-function-declaration] 432 | segments = skb_gso_segment(skb, 0); | ^~~~~~~~~~~~~~~ | skb_gso_reset /usr/src/ovpn-dco-0.0+git20230324/drivers/net/ovpn-dco/ovpn.c:432:26: warning: assignment to 'struct sk_buff *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 432 | segments = skb_gso_segment(skb, 0); | ^ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:243: /usr/src/ovpn-dco-0.0+git20230324/drivers/net/ovpn-dco/ovpn.o] Error 1 make[3]: *** [scripts/Makefile.build:480: /usr/src/ovpn-dco-0.0+git20230324/drivers/net/ovpn-dco] Error 2 make[2]: *** [/usr/src/linux-headers-6.5.0-rc5/Makefile:2032: /usr/src/ovpn-dco-0.0+git20230324] Error 2 make[1]: *** [Makefile:234: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.5.0-rc5' make: *** [Makefile:52: all] Error 2

gcc --version
gcc (Debian 13.2.0-1)

uname -a Linux ghost 6.5.0-rc5 #1 SMP PREEMPT_DYNAMIC Wed Aug 9 14:43:13 CEST 2023 x86_64 GNU/Linux


Kind Regards and thanks for your effort
mavoga commented 1 year ago

Same issue since kernel v6.4.10, adding

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10)
#include <net/gso.h>
#endif

in the include directives of drivers/net/ovpn-dco/ovpn.c allowed me to compile the module.

Thanks!

ordex commented 1 year ago

Thanks for the report and for the hints guys! I will fix ovpn-dco accordingly as soon as I have a chance to get to my workstation

ordex commented 1 year ago

Feel free to test latest master and report any finding. Thanks!

odivlad commented 1 year ago

Hi,

thanks for this fix!

I'm wonder whether it is possible to upload ovpn-dco codebase to fedora copr repository? Currently on FC38 it is impossible to install ovpn-dco from copr because of this compilation error:

Running transaction
  Preparing        :                                                                                                                                                                                                                      1/1
  Installing       : kernel-devel-matched-6.4.14-200.fc38.x86_64                                                                                                                                                                          1/3
  Installing       : dkms-3.0.11-1.fc38.noarch                                                                                                                                                                                            2/3
  Running scriptlet: dkms-3.0.11-1.fc38.noarch                                                                                                                                                                                            2/3
Created symlink /etc/systemd/system/multi-user.target.wants/dkms.service → /usr/lib/systemd/system/dkms.service.

  Installing       : kmod-ovpn-dco-0-20220905git3ba6c07.fc38.noarch                                                                                                                                                                       3/3
  Running scriptlet: kmod-ovpn-dco-0-20220905git3ba6c07.fc38.noarch                                                                                                                                                                       3/3
Loading new ovpn-dco-0.20220905git3ba6c07.fc38 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/ovpn-dco-0.20220905git3ba6c07.fc38/dkms.conf)
Building for 6.4.14-200.fc38.x86_64
Building initial module for 6.4.14-200.fc38.x86_64
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/source/dkms.conf)
Error! Bad return status for module build on kernel: 6.4.14-200.fc38.x86_64 (x86_64)
Consult /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/make.log for more information.
warning: %post(kmod-ovpn-dco-0-20220905git3ba6c07.fc38.noarch) scriptlet failed, exit status 10

Error in POSTIN scriptlet in rpm package kmod-ovpn-dco
  Verifying        : kmod-ovpn-dco-0-20220905git3ba6c07.fc38.noarch                                                                                                                                                                       1/3
  Verifying        : dkms-3.0.11-1.fc38.noarch                                                                                                                                                                                            2/3
  Verifying        : kernel-devel-matched-6.4.14-200.fc38.x86_64                                                                                                                                                                          3/3

Installed:
  dkms-3.0.11-1.fc38.noarch                                         kernel-devel-matched-6.4.14-200.fc38.x86_64                                         kmod-ovpn-dco-0-20220905git3ba6c07.fc38.noarch

Complete!

Compile log:

# cat /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/make.log
DKMS make.log for ovpn-dco-0.20220905git3ba6c07.fc38 for kernel 6.4.14-200.fc38.x86_64 (x86_64)
Sun Sep 10 03:31:13 PM MSK 2023
make: Entering directory '/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build'
/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/gen-compat-autoconf.sh /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/compat-autoconf.h
make -C /lib/modules/6.4.14-200.fc38.x86_64/build M=/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build PWD=/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build REVISION=copr:0.20220905git3ba6c07.fc38 CONFIG_OVPN_DCO=m INSTALL_MOD_DIR=updates/    modules
make[1]: Entering directory '/usr/src/kernels/6.4.14-200.fc38.x86_64'
  CC [M]  /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/main.o
  CC [M]  /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/bind.o
  CC [M]  /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/crypto.o
  CC [M]  /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/ovpn.o
/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/ovpn.c: In function ‘ovpn_net_xmit’:
/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/ovpn.c:468:28: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘skb_gso_reset’? [-Werror=implicit-function-declaration]
  468 |                 segments = skb_gso_segment(skb, 0);
      |                            ^~~~~~~~~~~~~~~
      |                            skb_gso_reset
/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/ovpn.c:468:26: warning: assignment to ‘struct sk_buff *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  468 |                 segments = skb_gso_segment(skb, 0);
      |                          ^
  CC [M]  /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/peer.o
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:252: /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/ovpn.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/peer.c: In function ‘ovpn_peer_create’:
/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/peer.c:91:9: error: implicit declaration of function ‘netif_tx_napi_add’; did you mean ‘netif_napi_add’? [-Werror=implicit-function-declaration]
   91 |         netif_tx_napi_add(ovpn->dev, &peer->napi, ovpn_napi_poll,
      |         ^~~~~~~~~~~~~~~~~
      |         netif_napi_add
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:252: /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco/peer.o] Error 1
make[2]: *** [scripts/Makefile.build:497: /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build/drivers/net/ovpn-dco] Error 2
make[1]: *** [Makefile:2050: /var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.4.14-200.fc38.x86_64'
make: *** [Makefile:52: all] Error 2
make: Leaving directory '/var/lib/dkms/ovpn-dco/0.20220905git3ba6c07.fc38/build'
fakemanhk commented 8 months ago

I find that in OpenWrt, this also having same error when I compile.

ordex commented 8 months ago

@fakemanhk the fix is in master

amarinderca commented 3 months ago

When will this make it to the openvpn rhel 9 repository?

flichtenheld commented 3 months ago

https://copr.fedorainfracloud.org/coprs/dsommers/openvpn3/ has been updated with the new version. packages.openvpn.net/openvpn3 will be updated some time this week. The only difference is that packages on packages.openvpn.net are officially supported.