aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ip_vs.h4
-rw-r--r--include/net/netfilter/nf_conntrack.h5
-rw-r--r--include/net/netfilter/nf_conntrack_core.h2
-rw-r--r--net/ipv4/netfilter/nf_nat_l3proto_ipv4.c4
-rw-r--r--net/ipv4/netfilter/nf_socket_ipv4.c2
-rw-r--r--net/ipv6/netfilter/nf_nat_l3proto_ipv6.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_ftp.c3
-rw-r--r--net/netfilter/ipvs/ip_vs_nfct.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c8
-rw-r--r--net/netfilter/nf_conntrack_netlink.c12
-rw-r--r--net/netfilter/xt_HMARK.c2
-rw-r--r--net/netfilter/xt_cluster.c3
-rw-r--r--net/netfilter/xt_connlabel.c2
-rw-r--r--net/netfilter/xt_connmark.c4
-rw-r--r--net/netfilter/xt_ipvs.c2
-rw-r--r--net/openvswitch/conntrack.c5
16 files changed, 17 insertions, 49 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 9a75d9933e63..632082300e77 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1555,7 +1555,7 @@ static inline void ip_vs_notrack(struct sk_buff *skb)
1555 enum ip_conntrack_info ctinfo; 1555 enum ip_conntrack_info ctinfo;
1556 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 1556 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
1557 1557
1558 if (!ct || !nf_ct_is_untracked(ct)) { 1558 if (ct) {
1559 nf_conntrack_put(&ct->ct_general); 1559 nf_conntrack_put(&ct->ct_general);
1560 nf_ct_set(skb, NULL, IP_CT_UNTRACKED); 1560 nf_ct_set(skb, NULL, IP_CT_UNTRACKED);
1561 } 1561 }
@@ -1616,7 +1616,7 @@ static inline bool ip_vs_conn_uses_conntrack(struct ip_vs_conn *cp,
1616 if (!(cp->flags & IP_VS_CONN_F_NFCT)) 1616 if (!(cp->flags & IP_VS_CONN_F_NFCT))
1617 return false; 1617 return false;
1618 ct = nf_ct_get(skb, &ctinfo); 1618 ct = nf_ct_get(skb, &ctinfo);
1619 if (ct && !nf_ct_is_untracked(ct)) 1619 if (ct)
1620 return true; 1620 return true;
1621#endif 1621#endif
1622 return false; 1622 return false;
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 012b99f563e5..4978a82b75fa 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -273,11 +273,6 @@ static inline int nf_ct_is_dying(const struct nf_conn *ct)
273 return test_bit(IPS_DYING_BIT, &ct->status); 273 return test_bit(IPS_DYING_BIT, &ct->status);
274} 274}
275 275
276static inline int nf_ct_is_untracked(const struct nf_conn *ct)
277{
278 return false;
279}
280
281/* Packet is received from loopback */ 276/* Packet is received from loopback */
282static inline bool nf_is_loopback_packet(const struct sk_buff *skb) 277static inline bool nf_is_loopback_packet(const struct sk_buff *skb)
283{ 278{
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 84ec7ca5f195..81d7f8a30945 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -65,7 +65,7 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
65 struct nf_conn *ct = (struct nf_conn *)skb_nfct(skb); 65 struct nf_conn *ct = (struct nf_conn *)skb_nfct(skb);
66 int ret = NF_ACCEPT; 66 int ret = NF_ACCEPT;
67 67
68 if (ct && !nf_ct_is_untracked(ct)) { 68 if (ct) {
69 if (!nf_ct_is_confirmed(ct)) 69 if (!nf_ct_is_confirmed(ct))
70 ret = __nf_conntrack_confirm(skb); 70 ret = __nf_conntrack_confirm(skb);
71 if (likely(ret == NF_ACCEPT)) 71 if (likely(ret == NF_ACCEPT))
diff --git a/net/ipv4/netfilter/nf_nat_l3proto_ipv4.c b/net/ipv4/netfilter/nf_nat_l3proto_ipv4.c
index 6f5e8d01b876..e3bfa6a169f0 100644
--- a/net/ipv4/netfilter/nf_nat_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_nat_l3proto_ipv4.c
@@ -264,10 +264,6 @@ nf_nat_ipv4_fn(void *priv, struct sk_buff *skb,
264 if (!ct) 264 if (!ct)
265 return NF_ACCEPT; 265 return NF_ACCEPT;
266 266
267 /* Don't try to NAT if this packet is not conntracked */
268 if (nf_ct_is_untracked(ct))
269 return NF_ACCEPT;
270
271 nat = nf_ct_nat_ext_add(ct); 267 nat = nf_ct_nat_ext_add(ct);
272 if (nat == NULL) 268 if (nat == NULL)
273 return NF_ACCEPT; 269 return NF_ACCEPT;
diff --git a/net/ipv4/netfilter/nf_socket_ipv4.c b/net/ipv4/netfilter/nf_socket_ipv4.c
index a83d558e1aae..e9293bdebba0 100644
--- a/net/ipv4/netfilter/nf_socket_ipv4.c
+++ b/net/ipv4/netfilter/nf_socket_ipv4.c
@@ -139,7 +139,7 @@ struct sock *nf_sk_lookup_slow_v4(struct net *net, const struct sk_buff *skb,
139 * SNAT-ted connection. 139 * SNAT-ted connection.
140 */ 140 */
141 ct = nf_ct_get(skb, &ctinfo); 141 ct = nf_ct_get(skb, &ctinfo);
142 if (ct && !nf_ct_is_untracked(ct) && 142 if (ct &&
143 ((iph->protocol != IPPROTO_ICMP && 143 ((iph->protocol != IPPROTO_ICMP &&
144 ctinfo == IP_CT_ESTABLISHED_REPLY) || 144 ctinfo == IP_CT_ESTABLISHED_REPLY) ||
145 (iph->protocol == IPPROTO_ICMP && 145 (iph->protocol == IPPROTO_ICMP &&
diff --git a/net/ipv6/netfilter/nf_nat_l3proto_ipv6.c b/net/ipv6/netfilter/nf_nat_l3proto_ipv6.c
index e0be97e636a4..922b5aef273c 100644
--- a/net/ipv6/netfilter/nf_nat_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_nat_l3proto_ipv6.c
@@ -273,10 +273,6 @@ nf_nat_ipv6_fn(void *priv, struct sk_buff *skb,
273 if (!ct) 273 if (!ct)
274 return NF_ACCEPT; 274 return NF_ACCEPT;
275 275
276 /* Don't try to NAT if this packet is not conntracked */
277 if (nf_ct_is_untracked(ct))
278 return NF_ACCEPT;
279
280 nat = nf_ct_nat_ext_add(ct); 276 nat = nf_ct_nat_ext_add(ct);
281 if (nat == NULL) 277 if (nat == NULL)
282 return NF_ACCEPT; 278 return NF_ACCEPT;
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index 1e589f8644ca..af3a9bbdf2ae 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -260,9 +260,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
260 buf_len = strlen(buf); 260 buf_len = strlen(buf);
261 261
262 ct = nf_ct_get(skb, &ctinfo); 262 ct = nf_ct_get(skb, &ctinfo);
263 if (ct && !nf_ct_is_untracked(ct) && (ct->status & IPS_NAT_MASK)) { 263 if (ct && nfct_nat(ct)) {
264 bool mangled; 264 bool mangled;
265
266 /* If mangling fails this function will return 0 265 /* If mangling fails this function will return 0
267 * which will cause the packet to be dropped. 266 * which will cause the packet to be dropped.
268 * Mangling can only fail under memory pressure, 267 * Mangling can only fail under memory pressure,
diff --git a/net/netfilter/ipvs/ip_vs_nfct.c b/net/netfilter/ipvs/ip_vs_nfct.c
index fc230d99aa3b..6cf3fd81a5ec 100644
--- a/net/netfilter/ipvs/ip_vs_nfct.c
+++ b/net/netfilter/ipvs/ip_vs_nfct.c
@@ -85,7 +85,7 @@ ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, int outin)
85 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 85 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
86 struct nf_conntrack_tuple new_tuple; 86 struct nf_conntrack_tuple new_tuple;
87 87
88 if (ct == NULL || nf_ct_is_confirmed(ct) || nf_ct_is_untracked(ct) || 88 if (ct == NULL || nf_ct_is_confirmed(ct) ||
89 nf_ct_is_dying(ct)) 89 nf_ct_is_dying(ct))
90 return; 90 return;
91 91
@@ -232,7 +232,7 @@ void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct,
232{ 232{
233 struct nf_conntrack_expect *exp; 233 struct nf_conntrack_expect *exp;
234 234
235 if (ct == NULL || nf_ct_is_untracked(ct)) 235 if (ct == NULL)
236 return; 236 return;
237 237
238 exp = nf_ct_expect_alloc(ct); 238 exp = nf_ct_expect_alloc(ct);
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 4e1a98fcc8c3..2eab1e0400f4 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -775,7 +775,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
775 enum ip_conntrack_info ctinfo; 775 enum ip_conntrack_info ctinfo;
776 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 776 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
777 777
778 if (ct && !nf_ct_is_untracked(ct)) { 778 if (ct) {
779 IP_VS_DBG_RL_PKT(10, AF_INET, pp, skb, ipvsh->off, 779 IP_VS_DBG_RL_PKT(10, AF_INET, pp, skb, ipvsh->off,
780 "ip_vs_nat_xmit(): " 780 "ip_vs_nat_xmit(): "
781 "stopping DNAT to local address"); 781 "stopping DNAT to local address");
@@ -866,7 +866,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
866 enum ip_conntrack_info ctinfo; 866 enum ip_conntrack_info ctinfo;
867 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 867 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
868 868
869 if (ct && !nf_ct_is_untracked(ct)) { 869 if (ct) {
870 IP_VS_DBG_RL_PKT(10, AF_INET6, pp, skb, ipvsh->off, 870 IP_VS_DBG_RL_PKT(10, AF_INET6, pp, skb, ipvsh->off,
871 "ip_vs_nat_xmit_v6(): " 871 "ip_vs_nat_xmit_v6(): "
872 "stopping DNAT to local address"); 872 "stopping DNAT to local address");
@@ -1338,7 +1338,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1338 enum ip_conntrack_info ctinfo; 1338 enum ip_conntrack_info ctinfo;
1339 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 1339 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
1340 1340
1341 if (ct && !nf_ct_is_untracked(ct)) { 1341 if (ct) {
1342 IP_VS_DBG(10, "%s(): " 1342 IP_VS_DBG(10, "%s(): "
1343 "stopping DNAT to local address %pI4\n", 1343 "stopping DNAT to local address %pI4\n",
1344 __func__, &cp->daddr.ip); 1344 __func__, &cp->daddr.ip);
@@ -1429,7 +1429,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1429 enum ip_conntrack_info ctinfo; 1429 enum ip_conntrack_info ctinfo;
1430 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 1430 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
1431 1431
1432 if (ct && !nf_ct_is_untracked(ct)) { 1432 if (ct) {
1433 IP_VS_DBG(10, "%s(): " 1433 IP_VS_DBG(10, "%s(): "
1434 "stopping DNAT to local address %pI6\n", 1434 "stopping DNAT to local address %pI6\n",
1435 __func__, &cp->daddr.in6); 1435 __func__, &cp->daddr.in6);
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 773d2187a5ea..83a1190504b4 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -627,10 +627,6 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item)
627 unsigned int flags = 0, group; 627 unsigned int flags = 0, group;
628 int err; 628 int err;
629 629
630 /* ignore our fake conntrack entry */
631 if (nf_ct_is_untracked(ct))
632 return 0;
633
634 if (events & (1 << IPCT_DESTROY)) { 630 if (events & (1 << IPCT_DESTROY)) {
635 type = IPCTNL_MSG_CT_DELETE; 631 type = IPCTNL_MSG_CT_DELETE;
636 group = NFNLGRP_CONNTRACK_DESTROY; 632 group = NFNLGRP_CONNTRACK_DESTROY;
@@ -2173,13 +2169,7 @@ ctnetlink_glue_build_size(const struct nf_conn *ct)
2173static struct nf_conn *ctnetlink_glue_get_ct(const struct sk_buff *skb, 2169static struct nf_conn *ctnetlink_glue_get_ct(const struct sk_buff *skb,
2174 enum ip_conntrack_info *ctinfo) 2170 enum ip_conntrack_info *ctinfo)
2175{ 2171{
2176 struct nf_conn *ct; 2172 return nf_ct_get(skb, ctinfo);
2177
2178 ct = nf_ct_get(skb, ctinfo);
2179 if (ct && nf_ct_is_untracked(ct))
2180 ct = NULL;
2181
2182 return ct;
2183} 2173}
2184 2174
2185static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct) 2175static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct)
diff --git a/net/netfilter/xt_HMARK.c b/net/netfilter/xt_HMARK.c
index 02afaf48a729..60e6dbe12460 100644
--- a/net/netfilter/xt_HMARK.c
+++ b/net/netfilter/xt_HMARK.c
@@ -84,7 +84,7 @@ hmark_ct_set_htuple(const struct sk_buff *skb, struct hmark_tuple *t,
84 struct nf_conntrack_tuple *otuple; 84 struct nf_conntrack_tuple *otuple;
85 struct nf_conntrack_tuple *rtuple; 85 struct nf_conntrack_tuple *rtuple;
86 86
87 if (ct == NULL || nf_ct_is_untracked(ct)) 87 if (ct == NULL)
88 return -1; 88 return -1;
89 89
90 otuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; 90 otuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple;
diff --git a/net/netfilter/xt_cluster.c b/net/netfilter/xt_cluster.c
index 9a9884a39c0e..57ef175dfbfa 100644
--- a/net/netfilter/xt_cluster.c
+++ b/net/netfilter/xt_cluster.c
@@ -121,9 +121,6 @@ xt_cluster_mt(const struct sk_buff *skb, struct xt_action_param *par)
121 if (ct == NULL) 121 if (ct == NULL)
122 return false; 122 return false;
123 123
124 if (nf_ct_is_untracked(ct))
125 return false;
126
127 if (ct->master) 124 if (ct->master)
128 hash = xt_cluster_hash(ct->master, info); 125 hash = xt_cluster_hash(ct->master, info);
129 else 126 else
diff --git a/net/netfilter/xt_connlabel.c b/net/netfilter/xt_connlabel.c
index 7827128d5a95..23372879e6e3 100644
--- a/net/netfilter/xt_connlabel.c
+++ b/net/netfilter/xt_connlabel.c
@@ -29,7 +29,7 @@ connlabel_mt(const struct sk_buff *skb, struct xt_action_param *par)
29 bool invert = info->options & XT_CONNLABEL_OP_INVERT; 29 bool invert = info->options & XT_CONNLABEL_OP_INVERT;
30 30
31 ct = nf_ct_get(skb, &ctinfo); 31 ct = nf_ct_get(skb, &ctinfo);
32 if (ct == NULL || nf_ct_is_untracked(ct)) 32 if (ct == NULL)
33 return invert; 33 return invert;
34 34
35 labels = nf_ct_labels_find(ct); 35 labels = nf_ct_labels_find(ct);
diff --git a/net/netfilter/xt_connmark.c b/net/netfilter/xt_connmark.c
index 9935d5029b0e..ec377cc6a369 100644
--- a/net/netfilter/xt_connmark.c
+++ b/net/netfilter/xt_connmark.c
@@ -44,7 +44,7 @@ connmark_tg(struct sk_buff *skb, const struct xt_action_param *par)
44 u_int32_t newmark; 44 u_int32_t newmark;
45 45
46 ct = nf_ct_get(skb, &ctinfo); 46 ct = nf_ct_get(skb, &ctinfo);
47 if (ct == NULL || nf_ct_is_untracked(ct)) 47 if (ct == NULL)
48 return XT_CONTINUE; 48 return XT_CONTINUE;
49 49
50 switch (info->mode) { 50 switch (info->mode) {
@@ -97,7 +97,7 @@ connmark_mt(const struct sk_buff *skb, struct xt_action_param *par)
97 const struct nf_conn *ct; 97 const struct nf_conn *ct;
98 98
99 ct = nf_ct_get(skb, &ctinfo); 99 ct = nf_ct_get(skb, &ctinfo);
100 if (ct == NULL || nf_ct_is_untracked(ct)) 100 if (ct == NULL)
101 return false; 101 return false;
102 102
103 return ((ct->mark & info->mask) == info->mark) ^ info->invert; 103 return ((ct->mark & info->mask) == info->mark) ^ info->invert;
diff --git a/net/netfilter/xt_ipvs.c b/net/netfilter/xt_ipvs.c
index 0fdc89064488..42540d26c2b8 100644
--- a/net/netfilter/xt_ipvs.c
+++ b/net/netfilter/xt_ipvs.c
@@ -116,7 +116,7 @@ ipvs_mt(const struct sk_buff *skb, struct xt_action_param *par)
116 enum ip_conntrack_info ctinfo; 116 enum ip_conntrack_info ctinfo;
117 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 117 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
118 118
119 if (ct == NULL || nf_ct_is_untracked(ct)) { 119 if (ct == NULL) {
120 match = false; 120 match = false;
121 goto out_put_cp; 121 goto out_put_cp;
122 } 122 }
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 7b2c2fce408a..57c68664d09c 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -795,11 +795,6 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key,
795 enum nf_nat_manip_type maniptype; 795 enum nf_nat_manip_type maniptype;
796 int err; 796 int err;
797 797
798 if (nf_ct_is_untracked(ct)) {
799 /* A NAT action may only be performed on tracked packets. */
800 return NF_ACCEPT;
801 }
802
803 /* Add NAT extension if not confirmed yet. */ 798 /* Add NAT extension if not confirmed yet. */
804 if (!nf_ct_is_confirmed(ct) && !nf_ct_nat_ext_add(ct)) 799 if (!nf_ct_is_confirmed(ct) && !nf_ct_nat_ext_add(ct))
805 return NF_ACCEPT; /* Can't NAT. */ 800 return NF_ACCEPT; /* Can't NAT. */