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
39
40
41
42
|
Patch from http://sourceforge.net/p/ipt-netflow/bugs-requests-patches/71/
--- a/ipt_NETFLOW.c
+++ b/ipt_NETFLOW.c
@@ -854,9 +854,15 @@
ipt_netflow_find(const struct ipt_netflow_tuple *tuple, unsigned int hash)
{
struct ipt_netflow *nf;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
struct hlist_node *pos;
+#endif
- hlist_for_each_entry(nf, pos, &ipt_netflow_hash[hash], hlist) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+ hlist_for_each_entry(nf, pos, &ipt_netflow_hash[hash], hlist) {
+#else
+ hlist_for_each_entry(nf, &ipt_netflow_hash[hash], hlist) {
+#endif
if (ipt_netflow_tuple_equal(tuple, &nf->tuple) &&
nf->nr_bytes < FLOW_FULL_WATERMARK) {
NETFLOW_STAT_INC(found);
@@ -1434,12 +1439,20 @@
}
#ifdef CONFIG_PROC_FS
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
proc_stat = create_proc_entry("ipt_netflow", S_IRUGO, INIT_NET(proc_net_stat));
+#else
+ proc_stat = proc_create("ipt_netflow", S_IRUGO, INIT_NET(proc_net_stat), &nf_seq_fops);
+#endif
if (!proc_stat) {
printk(KERN_ERR "Unable to create /proc/net/stat/ipt_netflow entry\n");
goto err_free_netflow_slab;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
proc_stat->proc_fops = &nf_seq_fops;
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
proc_stat->owner = THIS_MODULE;
#endif
|