summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-03-08 17:18:22 -0800
committerJarno Rajahalme <jarno@ovn.org>2017-03-08 17:20:15 -0800
commitd3c313c16b049013bf8e91840d506b9e360436d6 (patch)
tree1aefe030d6a69d234b41bc766777a66af5c29642 /datapath
parent83daade9b4c5ee7e76045f65fbe036c60be7a0f3 (diff)
downloadopenvswitch-d3c313c16b049013bf8e91840d506b9e360436d6.tar.gz
datapath: add and use skb_nfct helper
Upstream commit: commit cb9c68363efb6d1f950ec55fb06e031ee70db5fc Author: Florian Westphal <fw@strlen.de> Date: Mon Jan 23 18:21:56 2017 +0100 skbuff: add and use skb_nfct helper Followup patch renames skb->nfct and changes its type so add a helper to avoid intrusive rename change later. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/conntrack.c6
-rw-r--r--datapath/linux/compat/include/linux/skbuff.h11
2 files changed, 14 insertions, 3 deletions
diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index 36db32abb..ec354c3ad 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -763,8 +763,8 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
/* Associate skb with specified zone. */
if (tmpl) {
- if (skb->nfct)
- nf_conntrack_put(skb->nfct);
+ if (skb_nfct(skb))
+ nf_conntrack_put(skb_nfct(skb));
nf_conntrack_get(&tmpl->ct_general);
skb->nfct = &tmpl->ct_general;
skb->nfctinfo = IP_CT_NEW;
@@ -861,7 +861,7 @@ static int ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
if (err)
return err;
- ct = (struct nf_conn *)skb->nfct;
+ ct = (struct nf_conn *)skb_nfct(skb);
if (ct)
nf_ct_deliver_cached_events(ct);
}
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index 6c4593924..2a6cf2ffa 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -376,4 +376,15 @@ static inline __wsum lco_csum(struct sk_buff *skb)
return csum_partial(l4_hdr, csum_start - l4_hdr, partial);
}
#endif
+
+#ifndef HAVE_SKB_NFCT
+static inline struct nf_conntrack *skb_nfct(const struct sk_buff *skb)
+{
+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
+ return skb->nfct;
+#else
+ return NULL;
+#endif
+}
+#endif
#endif