1 commit 2b76b68c65c97fc11409088c3c30993324df8500
2 Author: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
3 Date: Thu Jan 4 18:50:50 2018 +0100
5 build: support for Linux 4.15
7 Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
9 diff --git a/extensions/pknock/xt_pknock.c b/extensions/pknock/xt_pknock.c
10 index 6fbdea4..31d4bc8 100644
11 --- a/extensions/pknock/xt_pknock.c
12 +++ b/extensions/pknock/xt_pknock.c
13 @@ -358,10 +358,20 @@ has_logged_during_this_minute(const struct peer *peer)
17 -peer_gc(unsigned long r)
19 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
20 + struct timer_list *tl
27 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
28 + struct xt_pknock_rule *rule = from_timer(rule, tl, timer);
30 struct xt_pknock_rule *rule = (struct xt_pknock_rule *)r;
33 struct list_head *pos, *n;
35 @@ -469,9 +479,13 @@ add_rule(struct xt_pknock_mtinfo *info)
36 if (rule->peer_head == NULL)
39 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
40 + timer_setup(&rule->timer, peer_gc, 0);
42 init_timer(&rule->timer);
43 rule->timer.function = peer_gc;
44 rule->timer.data = (unsigned long)rule;
47 rule->status_proc = proc_create_data(info->rule_name, 0, pde,
48 &pknock_proc_ops, rule);