1
0

Accepting request 573172 from security:netfilter

- Backport from upstream
  * Support for Linux 4.15 (add init_timer.patch)

OBS-URL: https://build.opensuse.org/request/show/573172
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xtables-addons?expand=0&rev=55
This commit is contained in:
Dominique Leuenberger 2018-02-06 15:49:37 +00:00 committed by Git OBS Bridge
commit 561b67dabe
3 changed files with 46 additions and 1 deletions

37
init_timer.patch Normal file
View File

@ -0,0 +1,37 @@
--- a/extensions/pknock/xt_pknock.c
+++ b/extensions/pknock/xt_pknock.c
@@ -357,11 +357,18 @@
*
* @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 @@
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);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Feb 5 17:55:51 UTC 2018 - suse+build@de-korte.org
- Backport from upstream
* Support for Linux 4.15 (add init_timer.patch)
-------------------------------------------------------------------
Wed Nov 22 17:38:47 UTC 2017 - jengelh@inai.de

View File

@ -1,7 +1,7 @@
#
# spec file for package xtables-addons
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -30,6 +30,7 @@ Source: http://downloads.sf.net/%name/%name-%version.tar.xz
Source2: http://downloads.sf.net/%name/%name-%version.tar.asc
Source3: %name-preamble
Source4: %name.keyring
Patch: init_timer.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: %kernel_module_package_buildreqs
@ -66,6 +67,7 @@ main kernel/iptables packages.
%prep
%setup -q
%patch -p1
%build
pushd ../