From: Rosen Penev <rosenp@gmail.com>
Date: Sat, 20 Mar 2021 21:58:49 +0000 (-0700)
Subject: coova-chili: fix compilation with kernel 5.10
X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=eba4abb65d9e12982a8c0f9e4674bcf5307e22de;p=feed%2Fpackages.git

coova-chili: fix compilation with kernel 5.10

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---

diff --git a/net/coova-chilli/patches/010-kernel510.patch b/net/coova-chilli/patches/010-kernel510.patch
new file mode 100644
index 0000000000..afdd586a4e
--- /dev/null
+++ b/net/coova-chilli/patches/010-kernel510.patch
@@ -0,0 +1,38 @@
+--- a/src/linux/xt_coova.c
++++ b/src/linux/xt_coova.c
+@@ -91,8 +91,12 @@ static DEFINE_MUTEX(coova_mutex);
+ 
+ #ifdef CONFIG_PROC_FS
+ static struct proc_dir_entry *coova_proc_dir;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)
++static const struct proc_ops coova_old_fops, coova_mt_fops;
++#else
+ static const struct file_operations coova_old_fops, coova_mt_fops;
+ #endif
++#endif
+ 
+ static u_int32_t hash_rnd;
+ static bool hash_rnd_initted;
+@@ -577,6 +581,14 @@ coova_mt_proc_write(struct file *file, c
+ 	return size + 1;
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)
++static const struct proc_ops coova_mt_fops = {
++	.proc_open    = coova_seq_open,
++	.proc_read    = seq_read,
++	.proc_write   = coova_mt_proc_write,
++	.proc_release = seq_release_private,
++};
++#else
+ static const struct file_operations coova_mt_fops = {
+ 	.open    = coova_seq_open,
+ 	.read    = seq_read,
+@@ -584,6 +596,7 @@ static const struct file_operations coov
+ 	.release = seq_release_private,
+ 	.owner   = THIS_MODULE,
+ };
++#endif
+ #endif /* CONFIG_PROC_FS */
+ 
+ static struct xt_match coova_mt_reg[] __read_mostly = {