File: 1003-fix-backward-compatible-building-with-kernel-5.3.patch

package info (click to toggle)
iptables-netflow 2.6-7.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,632 kB
  • sloc: ansic: 6,831; sh: 896; ruby: 619; makefile: 239
file content (38 lines) | stat: -rw-r--r-- 1,222 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From e1724954ece01cc13ed9d30d6a3527c71c906696 Mon Sep 17 00:00:00 2001
From: gnought <1684105+gnought@users.noreply.github.com>
Date: Mon, 1 May 2023 16:19:25 +0800
Subject: [PATCH] fix: backward compatible building with kernel <5.3

Origin: other, https://github.com/aabc/ipt-netflow/pull/217
---
 ipt_NETFLOW.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
index eee8074..ab05b24 100644
--- a/ipt_NETFLOW.c
+++ b/ipt_NETFLOW.c
@@ -1135,7 +1135,7 @@ static int flows_dump_seq_show(struct seq_file *seq, void *v)
 	seq_printf(seq, "%d %04x %x",
 	    st->pcache,
 	    hash_netflow(&nf->tuple),
-	    (!!inactive_needs_export(nf, i_timeout, jiffies)) | 
+	    (!!inactive_needs_export(nf, i_timeout, jiffies)) |
 	    (active_needs_export(nf, a_timeout, jiffies) << 1));
 	seq_printf(seq, " %hd,%hd",
 	    nf->tuple.i_ifc,
@@ -4503,7 +4503,11 @@ static void netflow_work_fn(struct work_struct *dummy)
 	wk_count = 0;
 	wk_trylock = 0;
 	wk_llist = 0;
+	#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
 	wk_cpu = __smp_processor_id();
+	#else
+	wk_cpu = smp_processor_id();
+	#endif
 	wk_start = jiffies;
 
 	pdus = netflow_scan_and_export(DONT_FLUSH);
-- 
2.39.5