Skip to content

Commit ca9a6ae

Browse files
committed
Fix module build for Linux v6.12
adapt to "move asm/unaligned.h to linux/unaligned.h" (5f60d5f6bbc12e782fac78110b0ee62698f3b576) in v6.12-rc2 Fixes: #237 Signed-off-by: Andreas Beckmann <anbe@debian.org>
1 parent c2d6eeb commit ca9a6ae

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

gen_compat_def

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ kbuild_test_symbol() {
6464
echo -n "Test function $* " >&2
6565
kbuild_test_compile ${1^^} $1 ${2-} <<-EOF
6666
#include <linux/module.h>
67-
${2:+#include <$2>}
67+
${3:-${2:+#include <$2>}}
6868
MODULE_LICENSE("GPL");
6969
void *test = $1;
7070
EOF
@@ -121,7 +121,12 @@ kbuild_test_symbol nf_bridge_info_get linux/netfilter_bridge.h
121121
# Stumbled on 5.9
122122
kbuild_test_struct vlan_dev_priv linux/if_vlan.h
123123
# Kernel version check broken by centos8
124-
kbuild_test_symbol put_unaligned_be24 asm/unaligned.h
124+
kbuild_test_symbol put_unaligned_be24 '???/unaligned.h' '#include <linux/version.h>
125+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,12,0)
126+
#include <linux/unaligned.h>
127+
#else
128+
#include <asm/unaligned.h>
129+
#endif'
125130
# totalram_pages changed from atomic to inline function.
126131
kbuild_test_symbol totalram_pages linux/mm.h
127132
kbuild_test_ref totalram_pages linux/mm.h

ipt_NETFLOW.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@
6868
# include <net/netfilter/nf_conntrack_core.h>
6969
#endif
7070
#include <linux/version.h>
71+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,12,0)
72+
#include <linux/unaligned.h>
73+
#else
7174
#include <asm/unaligned.h>
75+
#endif
7276
#ifdef HAVE_LLIST
7377
/* llist.h is officially defined since linux 3.1,
7478
* but centos6 have it backported on its 2.6.32.el6 */

0 commit comments

Comments
 (0)