diff options
Diffstat (limited to 'kernel-4.15.patch')
-rw-r--r-- | kernel-4.15.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/kernel-4.15.patch b/kernel-4.15.patch new file mode 100644 index 000000000000..72d4bc85cc19 --- /dev/null +++ b/kernel-4.15.patch @@ -0,0 +1,65 @@ +diff --git a/doc/changelog.txt b/doc/changelog.txt +index e3f421f..770ac06 100644 +--- a/doc/changelog.txt ++++ b/doc/changelog.txt +@@ -1,6 +1,8 @@ + + HEAD + ==== ++Enhancements: ++- support for Linux up to 4.15 + + + v2.14 (2017-11-22) +diff --git a/extensions/compat_xtables.h b/extensions/compat_xtables.h +index d8882ac..354884e 100644 +--- a/extensions/compat_xtables.h ++++ b/extensions/compat_xtables.h +@@ -93,4 +93,8 @@ static inline struct net *par_net(const struct xt_action_param *par) + #endif + } + ++#ifndef NF_CT_ASSERT ++# define NF_CT_ASSERT(x) WARN_ON(!(x)) ++#endif ++ + #endif /* _XTABLES_COMPAT_H */ +diff --git a/extensions/pknock/xt_pknock.c b/extensions/pknock/xt_pknock.c +index 6fbdea4..3f47d9b 100644 +--- a/extensions/pknock/xt_pknock.c ++++ b/extensions/pknock/xt_pknock.c +@@ -357,11 +357,18 @@ has_logged_during_this_minute(const struct peer *peer) + * + * @r: rule + */ +-static void +-peer_gc(unsigned long r) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++static void peer_gc(struct timer_list *tl) ++#else ++static void peer_gc(unsigned long r) ++#endif + { + unsigned int i; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ struct xt_pknock_rule *rule = from_timer(rule, tl, timer); ++#else + struct xt_pknock_rule *rule = (struct xt_pknock_rule *)r; ++#endif + struct peer *peer; + struct list_head *pos, *n; + +@@ -469,9 +476,13 @@ add_rule(struct xt_pknock_mtinfo *info) + if (rule->peer_head == NULL) + goto out; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ timer_setup(&rule->timer, peer_gc, 0); ++#else + init_timer(&rule->timer); + rule->timer.function = peer_gc; + rule->timer.data = (unsigned long)rule; ++#endif + + rule->status_proc = proc_create_data(info->rule_name, 0, pde, + &pknock_proc_ops, rule); |