mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 05:05:12 +02:00
xt_ACCOUNT: update prototype of nf_sockopt_ops::set callback
In 5.9, the `void __user` parameter has been replaced by a `sockptr`. Update `ipt_acc_set_ctl` appropriately. Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This commit is contained in:

committed by
Jan Engelhardt

parent
ea588d0b9c
commit
48e30a0990
@@ -28,6 +28,9 @@
|
|||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||||
|
#include <linux/sockptr.h>
|
||||||
|
#endif
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
#include <net/netns/generic.h>
|
#include <net/netns/generic.h>
|
||||||
@@ -879,7 +882,12 @@ static int ipt_acc_handle_get_data(struct ipt_acc_net *ian,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int ipt_acc_set_ctl(struct sock *sk, int cmd,
|
static int ipt_acc_set_ctl(struct sock *sk, int cmd,
|
||||||
void *user, unsigned int len)
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
||||||
|
void *user,
|
||||||
|
#else
|
||||||
|
sockptr_t arg,
|
||||||
|
#endif
|
||||||
|
unsigned int len)
|
||||||
{
|
{
|
||||||
struct net *net = sock_net(sk);
|
struct net *net = sock_net(sk);
|
||||||
struct ipt_acc_net *ian = net_generic(net, ipt_acc_net_id);
|
struct ipt_acc_net *ian = net_generic(net, ipt_acc_net_id);
|
||||||
@@ -898,7 +906,12 @@ static int ipt_acc_set_ctl(struct sock *sk, int cmd,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy_from_user(&handle, user, len)) {
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
||||||
|
if (copy_from_user(&handle, user, len))
|
||||||
|
#else
|
||||||
|
if (copy_from_sockptr(&handle, arg, len))
|
||||||
|
#endif
|
||||||
|
{
|
||||||
printk("ACCOUNT: ipt_acc_set_ctl: copy_from_user failed for "
|
printk("ACCOUNT: ipt_acc_set_ctl: copy_from_user failed for "
|
||||||
"IPT_SO_SET_HANDLE_FREE\n");
|
"IPT_SO_SET_HANDLE_FREE\n");
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user