aboutsummaryrefslogtreecommitdiffstats
path: root/community/miniupnpd/build-with-linux-kernel-5.0.patch
blob: 4728ae54b9d385f9116e10329b551d65e052c367 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
diff --git a/netfilter/iptcrdr.c b/netfilter/iptcrdr.c
index 48c6dbb..676d154 100644
--- a/netfilter/iptcrdr.c
+++ b/netfilter/iptcrdr.c
@@ -1116,9 +1116,13 @@ addnatrule(int proto, unsigned short eport,
 	} else {
 		match = get_udp_match(eport, 0);
 	}
-	e->nfcache = NFC_IP_DST_PT;
+#ifdef NFC_UNKNOWN
+	e->nfcache = NFC_UNKNOWN;
+#endif
 	target = get_dnat_target(iaddr, iport);
-	e->nfcache |= NFC_UNKNOWN;
+#ifdef NFC_IP_DST_PT
+	e->nfcache |= NFC_IP_DST_PT;
+#endif
 	tmp = realloc(e, sizeof(struct ipt_entry)
 	               + match->u.match_size
 				   + target->u.target_size);
@@ -1186,9 +1190,13 @@ addmasqueraderule(int proto,
 	} else {
 		match = get_udp_match(0, iport);
 	}
-	e->nfcache = NFC_IP_DST_PT;
-	target = get_masquerade_target(eport);
+#ifdef NFC_UNKNOWN
 	e->nfcache |= NFC_UNKNOWN;
+#endif
+	target = get_masquerade_target(eport);
+#ifdef NFC_IP_DST_PT
+	e->nfcache |= NFC_IP_DST_PT;
+#endif
 	tmp = realloc(e, sizeof(struct ipt_entry)
 	               + match->u.match_size
 				   + target->u.target_size);
@@ -1266,9 +1274,16 @@ addpeernatrule(int proto,
 	} else {
 		match = get_udp_match(rport, iport);
 	}
-	e->nfcache = NFC_IP_DST_PT | NFC_IP_SRC_PT;
-	target = get_snat_target(eaddr, eport);
+#ifdef NFC_UNKNOWN
 	e->nfcache |= NFC_UNKNOWN;
+#endif
+	target = get_snat_target(eaddr, eport);
+#ifdef NFC_IP_DST_PT
+	e->nfcache |= NFC_IP_DST_PT;
+#endif
+#ifdef NFC_IP_SRC_PT
+	e->nfcache |= NFC_IP_SRC_PT;
+#endif
 	tmp = realloc(e, sizeof(struct ipt_entry)
 	               + match->u.match_size
 				   + target->u.target_size);
@@ -1337,9 +1352,16 @@ addpeerdscprule(int proto, unsigned char dscp,
 	} else {
 		match = get_udp_match(rport, iport);
 	}
-	e->nfcache = NFC_IP_DST_PT | NFC_IP_SRC_PT;
-	target = get_dscp_target(dscp);
+#ifdef NFC_UNKNOWN
 	e->nfcache |= NFC_UNKNOWN;
+#endif
+	target = get_dscp_target(dscp);
+#ifdef NFC_IP_DST_PT
+	e->nfcache |= NFC_IP_DST_PT;
+#endif
+#ifdef NFC_IP_SRC_PT
+	e->nfcache |= NFC_IP_SRC_PT;
+#endif
 	tmp = realloc(e, sizeof(struct ipt_entry)
 	               + match->u.match_size
 				   + target->u.target_size);
@@ -1420,11 +1442,15 @@ add_filter_rule(int proto, const char * rhost,
 	} else {
 		match = get_udp_match(iport,0);
 	}
-	e->nfcache = NFC_IP_DST_PT;
 	e->ip.dst.s_addr = inet_addr(iaddr);
 	e->ip.dmsk.s_addr = INADDR_NONE;
-	target = get_accept_target();
+#ifdef NFC_UNKNOWN
 	e->nfcache |= NFC_UNKNOWN;
+#endif
+	target = get_accept_target();
+#ifdef NFC_IP_DST_PT
+	e->nfcache |= NFC_IP_DST_PT;
+#endif
 	tmp = realloc(e, sizeof(struct ipt_entry)
 	               + match->u.match_size
 				   + target->u.target_size);