From 778ce3c9776b54fb83cfaea50f793c2c7031c32a Mon Sep 17 00:00:00 2001 From: John Thomson Date: Fri, 21 Oct 2022 13:49:42 +1000 Subject: [PATCH] coova-chilli: fix kernel >= 5.17 compile Signed-off-by: John Thomson --- net/coova-chilli/Makefile | 2 +- net/coova-chilli/patches/011-kernel517.patch | 34 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 net/coova-chilli/patches/011-kernel517.patch diff --git a/net/coova-chilli/Makefile b/net/coova-chilli/Makefile index b96fccbc1..97d2acf38 100644 --- a/net/coova-chilli/Makefile +++ b/net/coova-chilli/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=coova-chilli PKG_VERSION:=1.6 -PKG_RELEASE:=9.1 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/coova/coova-chilli/tar.gz/$(PKG_VERSION)? diff --git a/net/coova-chilli/patches/011-kernel517.patch b/net/coova-chilli/patches/011-kernel517.patch new file mode 100644 index 000000000..e66a7c147 --- /dev/null +++ b/net/coova-chilli/patches/011-kernel517.patch @@ -0,0 +1,34 @@ +From: John Thomson +Date: 21 Oct 2022 13:00:00 +1000 +Subject: [PATCH] xt_coova: fix kernel>=5.17 + +Linux kernel 5.17 removed PDE_DATA, and replaced it with pde_data [0] + +[0]: https://github.com/torvalds/linux/commit/359745d78351c6f5442435f81549f0207ece28aa + +Signed-off-by: John Thomson + +--- a/src/linux/xt_coova.c ++++ b/src/linux/xt_coova.c +@@ -470,7 +470,9 @@ static int coova_seq_open(struct inode * + if (st == NULL) + return -ENOMEM; + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) ++ st->table = pde_data(inode); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + st->table = PDE_DATA(inode); + #else + st->table = pde->data; +@@ -482,7 +484,9 @@ static ssize_t + coova_mt_proc_write(struct file *file, const char __user *input, + size_t size, loff_t *loff) + { +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) ++ struct coova_table *t = pde_data(file_inode(file)); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + struct coova_table *t = PDE_DATA(file_inode(file)); + #else + const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);