Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master branch does not compile on kernel 6.2-rc4 #12

Closed
xevilstar opened this issue Jan 3, 2023 · 18 comments
Closed

master branch does not compile on kernel 6.2-rc4 #12

xevilstar opened this issue Jan 3, 2023 · 18 comments
Labels
enhancement New feature or request

Comments

@xevilstar
Copy link

git clone https://github.com/OpenVPN/ovpn-dco.git
Cloning into 'ovpn-dco'...
remote: Enumerating objects: 3240, done.
remote: Counting objects: 100% (692/692), done.
remote: Compressing objects: 100% (275/275), done.
remote: Total 3240 (delta 352), reused 665 (delta 328), pack-reused 2548
Receiving objects: 100% (3240/3240), 1008.00 KiB | 3.92 MiB/s, done.
Resolving deltas: 100% (1836/1836), done.
root@ghost:/usr/src# cd ovpn-dco
root@ghost:/usr/src/ovpn-dco# make KERNEL_SRC=/usr/src/linux-6.2-rc2
/usr/src/ovpn-dco/gen-compat-autoconf.sh /usr/src/ovpn-dco/compat-autoconf.h
make -C /usr/src/linux-6.2-rc2 M=/usr/src/ovpn-dco PWD=/usr/src/ovpn-dco REVISION=0.1.20221107 CONFIG_OVPN_DCO=m INSTALL_MOD_DIR=updates/ modules
make[1]: Entering directory '/usr/src/linux-6.2-rc2'
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/main.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/bind.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/crypto.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/ovpn.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/peer.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/sock.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/stats.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.o
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:950:21: error: initialization of 'int (*)(const struct genl_split_ops *, struct sk_buff *, struct genl_info )' from incompatible pointer type 'int ()(const struct genl_ops *, struct sk_buff *, struct genl_info )' [-Werror=incompatible-pointer-types]
950 | .pre_doit = ovpn_pre_doit,
| ^~~~~~~~~~~~~
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:950:21: note: (near initialization for 'ovpn_netlink_family.pre_doit')
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:951:22: error: initialization of 'void (
)(const struct genl_split_ops *, struct sk_buff *, struct genl_info )' from incompatible pointer type 'void ()(const struct genl_ops *, struct sk_buff *, struct genl_info *)' [-Werror=incompatible-pointer-types]
951 | .post_doit = ovpn_post_doit,
| ^~~~~~~~~~~~~~
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:951:22: note: (near initialization for 'ovpn_netlink_family.post_doit')
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:252: /usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.o] Error 1
make[2]: *** [scripts/Makefile.build:504: /usr/src/ovpn-dco/drivers/net/ovpn-dco] Error 2
make[1]: *** [Makefile:2008: /usr/src/ovpn-dco] Error 2
make[1]: Leaving directory '/usr/src/linux-6.2-rc2'
make: *** [Makefile:52: all] Error 2

@ordex
Copy link
Member

ordex commented Jan 4, 2023

Hi! This is work in progress and will update the code ASAP

@xevilstar
Copy link
Author

if you have already some patches I am available to test it

@xevilstar
Copy link
Author

news ?

@schwabe
Copy link
Contributor

schwabe commented Jan 8, 2023

Don't be pushy. It is ready when it is ready.

@xevilstar
Copy link
Author

gcc --version
gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@ghost:/usr/src/ovpn-dco# cc --version
cc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@ordex ordex added the enhancement New feature or request label Jan 15, 2023
@xevilstar xevilstar changed the title master branch does not compile on kernel 6.2-rc2 master branch does not compile on kernel 6.2-rc4 Jan 18, 2023
@xevilstar
Copy link
Author

make
/usr/src/ovpn-dco/gen-compat-autoconf.sh /usr/src/ovpn-dco/compat-autoconf.h
make -C /lib/modules/6.2.0-rc4/build M=/usr/src/ovpn-dco PWD=/usr/src/ovpn-dco REVISION=0.1.20221107-3-g2fbc4e8 CONFIG_OVPN_DCO=m INSTALL_MOD_DIR=updates/ modules
make[1]: Entering directory '/usr/src/linux-headers-6.2.0-rc4'
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/main.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/bind.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/crypto.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/ovpn.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/peer.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/sock.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/stats.o
CC [M] /usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.o
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:950:21: error: initialization of 'int (*)(const struct genl_split_ops *, struct sk_buff *, struct genl_info )' from incompatible pointer type 'int ()(const struct genl_ops *, struct sk_buff *, struct genl_info )' [-Werror=incompatible-pointer-types]
950 | .pre_doit = ovpn_pre_doit,
| ^~~~~~~~~~~~~
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:950:21: note: (near initialization for 'ovpn_netlink_family.pre_doit')
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:951:22: error: initialization of 'void (
)(const struct genl_split_ops *, struct sk_buff *, struct genl_info )' from incompatible pointer type 'void ()(const struct genl_ops *, struct sk_buff *, struct genl_info *)' [-Werror=incompatible-pointer-types]
951 | .post_doit = ovpn_post_doit,
| ^~~~~~~~~~~~~~
/usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.c:951:22: note: (near initialization for 'ovpn_netlink_family.post_doit')
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:252: /usr/src/ovpn-dco/drivers/net/ovpn-dco/netlink.o] Error 1
make[2]: *** [scripts/Makefile.build:504: /usr/src/ovpn-dco/drivers/net/ovpn-dco] Error 2
make[1]: *** [Makefile:2008: /usr/src/ovpn-dco] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.2.0-rc4'
make: *** [Makefile:52: all] Error 2
root@ghost:/usr/src/ovpn-dco# uname -a
Linux ghost 6.2.0-rc4 #2 SMP PREEMPT_DYNAMIC Tue Jan 17 13:35:46 CET 2023 x86_64 GNU/Linux

@ordex
Copy link
Member

ordex commented Jan 18, 2023

I think you forgot to add some message?
The compiler output is pretty clear already, no need to post it again :)

The netlink ops struct has been redesigned and it requires ovpn-dco to adapt to the new definition.
Unfortunately right now there are a couple of bugs on my plate which require higher attention.

Port to latest kernel will happen right after!

Thanks for bearing with me

@xevilstar
Copy link
Author

sorry ....

I tried to patch it myself with my hello.c knowledge but obviously apart from the risk of exploding or starting ww3 I haven't got much ;)

@ordex
Copy link
Member

ordex commented Jan 18, 2023

glad none of the two events happened :-D
Anyway, I should be able to get it done soonish.

@ordex
Copy link
Member

ordex commented Jan 20, 2023

@xevilstar could you give a try to the genl_split_ops branch and let me know how it goes?
Thanks!

@xevilstar
Copy link
Author

xevilstar commented Jan 20, 2023 via email

@xevilstar
Copy link
Author

no

[Fri Jan 20 17:32:39 2023] ovpn: can't register netlink family
[Fri Jan 20 17:32:39 2023] ovpn: initialization failed, error status=-22

@xevilstar
Copy link
Author

cannot modprobe cannot insmod

@ordex
Copy link
Member

ordex commented Jan 20, 2023

Thanks for testing. This is an issue that started with 6.1. Will fix this soon too 😅

@ordex
Copy link
Member

ordex commented Jan 20, 2023

Let's open a specific issue for that, please

@ordex
Copy link
Member

ordex commented Jan 20, 2023

compilation is now fixed. However, we need to come up with some non-trivial compat code that allows the new code to still compile on older kernels.

@ordex ordex closed this as completed in 95b3011 Jan 24, 2023
ordex added a commit that referenced this issue Jan 24, 2023
netlink commands do not truly require all the bells and whistles
from the genl_ops structure, therefore it is possible to switch to the
smaller and slimmer genl_small_ops.

At the same time, this structure will be easier to be maintained
compatible with newer and older kernels.

Fixes: #12
Fixes: #20
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
@xevilstar
Copy link
Author

Thanks, now ... there should be a way to make this new source get into debian dkms package ..... ;)

@ordex
Copy link
Member

ordex commented Jan 24, 2023

Yeah, hopefully they will pull the next tag (which I plan to stamp at the end of the month)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants