Skip to content

Commit d3e29f7

Browse files
committed
Fix module build for Linux v6.11
adapt to "sysctl: treewide: constify the ctl_table argument of proc_handlers" (78eb4ea25cd5fdbdae7eb9fdf87b99195ff67508) in v6.11-rc1 Signed-off-by: Andreas Beckmann <anbe@debian.org>
1 parent 975e2fe commit d3e29f7

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

compat.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,4 +794,10 @@ struct module *find_module(const char *name)
794794
# define NF_CT_EVENT const struct nf_ct_event
795795
#endif
796796

797+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,11,0)
798+
#define procctl_const const
799+
#else
800+
#define procctl_const
801+
#endif
802+
797803
#endif /* COMPAT_NETFLOW_H */

ipt_NETFLOW.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ static int switch_promisc(int newpromisc)
15201520

15211521
#ifdef CONFIG_SYSCTL
15221522
/* sysctl /proc/sys/net/netflow */
1523-
static int hsize_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1523+
static int hsize_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
15241524
void __user *buffer, size_t *lenp, loff_t *fpos)
15251525
{
15261526
int ret, hsize;
@@ -1537,7 +1537,7 @@ static int hsize_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp
15371537
return ret;
15381538
}
15391539

1540-
static int sndbuf_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1540+
static int sndbuf_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
15411541
void __user *buffer, size_t *lenp, loff_t *fpos)
15421542
{
15431543
int ret;
@@ -1572,7 +1572,7 @@ static int sndbuf_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *fil
15721572
}
15731573

15741574
static void free_templates(void);
1575-
static int destination_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1575+
static int destination_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
15761576
void __user *buffer, size_t *lenp, loff_t *fpos)
15771577
{
15781578
int ret;
@@ -1589,7 +1589,7 @@ static int destination_procctl(ctl_table *ctl, int write, BEFORE2632(struct file
15891589
}
15901590

15911591
#ifdef ENABLE_AGGR
1592-
static int aggregation_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1592+
static int aggregation_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
15931593
void __user *buffer, size_t *lenp, loff_t *fpos)
15941594
{
15951595
int ret;
@@ -1604,7 +1604,7 @@ static int aggregation_procctl(ctl_table *ctl, int write, BEFORE2632(struct file
16041604
#endif
16051605

16061606
#ifdef ENABLE_PROMISC
1607-
static int promisc_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1607+
static int promisc_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
16081608
void __user *buffer, size_t *lenp, loff_t *fpos)
16091609
{
16101610
int newpromisc = promisc;
@@ -1621,7 +1621,7 @@ static int promisc_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *fi
16211621

16221622
#ifdef ENABLE_SAMPLER
16231623
static int parse_sampler(char *ptr);
1624-
static int sampler_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1624+
static int sampler_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
16251625
void __user *buffer, size_t *lenp, loff_t *fpos)
16261626
{
16271627
int ret;
@@ -1654,7 +1654,7 @@ static int sampler_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *fi
16541654

16551655
#ifdef SNMP_RULES
16561656
static int add_snmp_rules(char *ptr);
1657-
static int snmp_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1657+
static int snmp_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
16581658
void __user *buffer, size_t *lenp, loff_t *fpos)
16591659
{
16601660
int ret;
@@ -1679,7 +1679,7 @@ static void clear_ipt_netflow_stat(void)
16791679
}
16801680
}
16811681

1682-
static int flush_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1682+
static int flush_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
16831683
void __user *buffer, size_t *lenp, loff_t *fpos)
16841684
{
16851685
int ret;
@@ -1708,7 +1708,7 @@ static int flush_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp
17081708
return ret;
17091709
}
17101710

1711-
static int protocol_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1711+
static int protocol_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
17121712
void __user *buffer, size_t *lenp, loff_t *fpos)
17131713
{
17141714
int ret;
@@ -1741,7 +1741,7 @@ static int protocol_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *f
17411741
#ifdef CONFIG_NF_NAT_NEEDED
17421742
static void register_ct_events(void);
17431743
static void unregister_ct_events(void);
1744-
static int natevents_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
1744+
static int natevents_procctl(procctl_const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
17451745
void __user *buffer, size_t *lenp, loff_t *fpos)
17461746
{
17471747
int ret;

0 commit comments

Comments
 (0)