summaryrefslogtreecommitdiff
blob: a10d994099fd67756e42dee54c212c41da745a6e (plain)
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
Port of 4.18 patch[1] to version 3.7 of rtsp-conntrack

[1] - https://github.com/maru-sama/rtsp-linux/pull/7

--- a/nf_nat_rtsp.c	2018-08-27 12:53:39.991467210 +0300
+++ b/nf_nat_rtsp.c	2018-08-27 12:53:56.087466258 +0300
@@ -31,6 +31,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/version.h>
 #include <net/tcp.h>
 #include <net/netfilter/nf_nat.h>
 #include <net/netfilter/nf_nat_helper.h>
@@ -430,7 +431,13 @@
 
 static void expected(struct nf_conn* ct, struct nf_conntrack_expect *exp)
 {
+    #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)
+    struct nf_nat_range2 range;
+    #elif LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
     struct nf_nat_range range;
+    #else
+    struct nf_nat_ipv4_range range;
+    #endif
     union nf_inet_addr newdstip, newsrcip, newip;
 
     struct nf_conn *master = ct->master;