Skip to content

general updates for kernel version compatiblity #239

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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

jkroonza
Copy link

@jkroonza jkroonza commented Mar 16, 2025

This builds on top of #233.

After pushing this and looking at the comment logs of some other PRs, I think #230, #221, #217 and #216 might also be covered by this. This was tested against kernel 6.12.1.

There is one question in my mind still:

  1. The check for strscpy could be simplified to have nothing in gen_compat_def, and merely rely on:
#ifndef strscpy
#define strcpy(...) strlcpy(__VA_ARGS__)
#endif

The definition here is also slightly different, and arguably better, cleaner.

Otherwise I believe this covers everything required.

anbe42 and others added 12 commits March 1, 2025 04:57
Fixes: 40fefb2 ("compat: Fix __has_attribute usage")
Signed-off-by: Andreas Beckmann <anbe@debian.org>
and do not query unrelated modules

Signed-off-by: Andreas Beckmann <anbe@debian.org>
the recursive calls slowed down the configure script significantly

Signed-off-by: Andreas Beckmann <anbe@debian.org>
Signed-off-by: Andreas Beckmann <anbe@debian.org>
skb_reset_mac_len() was introduced in v3.0-rc3
and is used unconditionally

Signed-off-by: Andreas Beckmann <anbe@debian.org>
netif_is_bridge_port() was introduced in v4.4-rc2 by
"vlan: Do not put vlan headers back on bridge and macvlan ports"
(28f9ee22bcdd84726dbf6267d0b58f254166b900)

Signed-off-by: Andreas Beckmann <anbe@debian.org>
Signed-off-by: Andreas Beckmann <anbe@debian.org>
adapt to "move asm/unaligned.h to linux/unaligned.h"
(5f60d5f6bbc12e782fac78110b0ee62698f3b576) in v6.12-rc2

Fixes: aabc#237
Signed-off-by: Andreas Beckmann <anbe@debian.org>
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
strscpy has been around since 4.3, and strlcpy got removed in 6.8.

This patch switches to the plainly preferred strscpy whenever it is
available, but will define that to strlcpy if strscpy (sized_strscpy due
to strscpy really being a macro) is not available.

Ideally we want to compile a test-call, but kbuild_test_symbol() doesn't
work that way.

We could also simply go "#ifndef strscpy ... # define strscpy strlcpy"
if that would be preferred.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
I've verified and traced this back to the initial import into git,
around version 2.6.12 of the kernel.  If anybody fails to compile
against older than that I think we can look into this but highly doubt
that'll be an issue.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
@jkroonza jkroonza changed the title Dkms fixes general updates for kernel version compatiblity Mar 16, 2025
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
For backwards compatiblity this gets pretty nasty.  This should work
fairly well.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
@jkroonza
Copy link
Author

Updated PR with non-default ./configure options too. primarily for the u32 random stuff, much of the history is difficult to track to specific version numbers, so linux/random.h is included always, and prandom.h only if available and needed.

jkroonza added a commit to jkroonza/gentoo that referenced this pull request Mar 17, 2025
Snapshot version of aabc/ipt-netflow#239

Naming is such that if an official 2.6.x gets released, this will
supercede that, but 2.7 will be "newer".  This isn't quite live, and I
don't like this, one bit, but it's a workable solution.  Extra .0 so
that we can bump these "semi live" versions at a later stage.

I also updated the -gentoo.patch to sort out LDFLAGS not respected QA
error.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Bug: https://bugs.gentoo.org/950506
Bug: https://bugs.gentoo.org/831306
@jkroonza
Copy link
Author

Tested with more combinations of /configure now, that matters for Gentoo, and I'm 99% sure of these commits. Would appreciate review on this, and pointers please if there is anything anyone is unhappy with.

jkroonza added a commit to jkroonza/gentoo that referenced this pull request Mar 17, 2025
Snapshot version of aabc/ipt-netflow#239

I also updated the -gentoo.patch to sort out LDFLAGS not respected QA
error.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Bug: https://bugs.gentoo.org/950506
Bug: https://bugs.gentoo.org/831306
jkroonza added a commit to jkroonza/gentoo that referenced this pull request Mar 17, 2025
Snapshot version of aabc/ipt-netflow#239

Updated the -gentoo.patch to sort out LDFLAGS not respected QA error.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Bug: https://bugs.gentoo.org/950506
Bug: https://bugs.gentoo.org/831306
@k0ste
Copy link

k0ste commented May 1, 2025

Tested with more combinations of /configure now, that matters for Gentoo, and I'm 99% sure of these commits. Would appreciate review on this, and pointers please if there is anything anyone is unhappy with.

Added to Arch ✔️

gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request May 21, 2025
Snapshot version of aabc/ipt-netflow#239

Updated the -gentoo.patch to sort out LDFLAGS not respected QA error.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Bug: https://bugs.gentoo.org/950506
Bug: https://bugs.gentoo.org/831306
Part-of: #41138
Closes: #41138
Signed-off-by: Sam James <sam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants