1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
From 0eb2092e930c78fc726d5d05abbcc81aa6c41b89 Mon Sep 17 00:00:00 2001
From: ABC <abc@openwall.com>
Date: Mon, 26 Jun 2023 16:29:58 -0300
Subject: [PATCH 17/17] Build compatibility with v6.4 (register_sysctl_paths)
'register_sysctl_paths' is missed from v6.4 due to 0199849acd07
("sysctl: remove register_sysctl_paths()").
Signed-off-by: ABC <abc@openwall.com>
---
gen_compat_def | 2 ++
ipt_NETFLOW.c | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/gen_compat_def b/gen_compat_def
index 396fdb9..a9cb95e 100755
--- a/gen_compat_def
+++ b/gen_compat_def
@@ -127,6 +127,8 @@ kbuild_test_symbol totalram_pages linux/mm.h
kbuild_test_ref totalram_pages linux/mm.h
# b86c0e6429da ("netfilter: ecache: prepare for event notifier merge")
kbuild_test_member nf_ct_event_notifier.ct_event net/netfilter/nf_conntrack_ecache.h
+# 6.4: 0199849acd07 ("sysctl: remove register_sysctl_paths()")
+kbuild_test_symbol register_sysctl_paths linux/sysctl.h
echo "// End of compat_def.h"
diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
index b3c2c99..eee8074 100644
--- a/ipt_NETFLOW.c
+++ b/ipt_NETFLOW.c
@@ -1929,16 +1929,18 @@ static ctl_table netflow_net_table[] = {
{ }
};
#else /* >= 2.6.25 */
+# ifdef HAVE_REGISTER_SYSCTL_PATHS
static struct ctl_path netflow_sysctl_path[] = {
{
.procname = "net",
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
.ctl_name = CTL_NET
-#endif
+# endif
},
{ .procname = "netflow" },
{ }
};
+# endif
#endif /* 2.6.25 */
#endif /* CONFIG_SYSCTL */
@@ -5666,7 +5668,11 @@ static int __init ipt_netflow_init(void)
#endif
);
#else /* 2.6.25 */
+# ifdef HAVE_REGISTER_SYSCTL_PATHS
netflow_sysctl_header = register_sysctl_paths(netflow_sysctl_path, netflow_sysctl_table);
+# else
+ netflow_sysctl_header = register_sysctl("net/netflow", netflow_sysctl_table);
+# endif
#endif
if (!netflow_sysctl_header) {
printk(KERN_ERR "netflow: can't register to sysctl\n");
--
2.39.5
|