coova-chilli: fix kernel >= 5.17 compile
authorJohn Thomson <git@johnthomson.fastmail.com.au>
Fri, 21 Oct 2022 03:49:42 +0000 (13:49 +1000)
committerRosen Penev <rosenp@gmail.com>
Fri, 30 Jun 2023 00:44:08 +0000 (17:44 -0700)
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
net/coova-chilli/Makefile
net/coova-chilli/patches/011-kernel517.patch [new file with mode: 0644]

index b96fccbc1adc4c466a5f5208ac03823d2c46e06f..97d2acf38b44017bc64a917399c4f07ad93d44cf 100644 (file)
@@ -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 (file)
index 0000000..e66a7c1
--- /dev/null
@@ -0,0 +1,34 @@
+From: John Thomson <git@johnthomson.fastmail.com.au>
+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 <git@johnthomson.fastmail.com.au>
+
+--- 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);