Skip to content

Commit

Permalink
Fix compilation with kernel 6.4 due to register_sysctl_paths removal
Browse files Browse the repository at this point in the history
Fixes: aabc#220

Based on
kalamlacki/ipt-netflow@2a1d250 and
kalamlacki/ipt-netflow@373b587 by
@kalamlacki but does still support compiling with older kernel
versions.

Reference for the register_sysctl_paths removal:
torvalds/linux@0199849
  • Loading branch information
xtaran committed Jul 6, 2023
1 parent b049e91 commit 2423308
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ipt_NETFLOW.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,6 +1929,7 @@ static ctl_table netflow_net_table[] = {
{ }
};
#else /* >= 2.6.25 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
static struct ctl_path netflow_sysctl_path[] = {
{
.procname = "net",
Expand All @@ -1939,6 +1940,7 @@ static struct ctl_path netflow_sysctl_path[] = {
{ .procname = "netflow" },
{ }
};
#endif /* 6.4.0 */
#endif /* 2.6.25 */
#endif /* CONFIG_SYSCTL */

Expand Down Expand Up @@ -5666,8 +5668,12 @@ static int __init ipt_netflow_init(void)
#endif
);
#else /* 2.6.25 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
netflow_sysctl_header = register_sysctl_paths(netflow_sysctl_path, netflow_sysctl_table);
#endif
#else
netflow_sysctl_header = register_sysctl("net/netflow", netflow_sysctl_table);
#endif /* 6.4.0 */
#endif /* 2.6.25 */
if (!netflow_sysctl_header) {
printk(KERN_ERR "netflow: can't register to sysctl\n");
goto err_free_proc_stat3;
Expand Down

0 comments on commit 2423308

Please sign in to comment.