summaryrefslogtreecommitdiffstats
path: root/package/kernel/nat46/patches/100-kernel-5.4-compat.patch
blob: 6a638e96b5ad67a497f7cfe820c6c8faf123f9a1 (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
29
30
31
32
33
34
--- a/nat46/modules/nat46-core.c
+++ b/nat46/modules/nat46-core.c
@@ -17,6 +17,7 @@
  */
 
 #include <net/route.h>
+#include <linux/version.h>
 
 #include "nat46-glue.h"
 #include "nat46-core.h"
@@ -1601,7 +1602,11 @@ void nat46_ipv6_input(struct sk_buff *ol
   /* Remove any debris in the socket control block */
   memset(IPCB(new_skb), 0, sizeof(struct inet_skb_parm));
   /* Remove netfilter references to IPv6 packet, new netfilter references will be created based on IPv4 packet */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
   nf_reset(new_skb);
+#else
+  nf_reset_ct(new_skb);
+#endif
 
   /* modify packet: actual IPv6->IPv4 transformation */
   truncSize = v6packet_l3size - sizeof(struct iphdr); /* chop first 20 bytes */
@@ -1806,7 +1811,11 @@ void nat46_ipv4_input(struct sk_buff *ol
   /* Remove any debris in the socket control block */
   memset(IPCB(new_skb), 0, sizeof(struct inet_skb_parm));
   /* Remove netfilter references to IPv4 packet, new netfilter references will be created based on IPv6 packet */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
   nf_reset(new_skb);
+#else
+  nf_reset_ct(new_skb);
+#endif
 
   /* expand header (add 20 extra bytes at the beginning of sk_buff) */
   pskb_expand_head(new_skb, IPV6V4HDRDELTA + (add_frag_header?8:0), 0, GFP_ATOMIC);