netfilter: add and use nf_ct_set helper
Add a helper to assign a nf_conn entry and the ctinfo bits to an sk_buff. This avoids changing code in followup patch that merges skb->nfct and skb->nfctinfo into skb->_nfct. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:

committed by
Pablo Neira Ayuso

parent
cb9c68363e
commit
c74454fadd
@@ -460,8 +460,7 @@ ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone,
|
||||
|
||||
ct = nf_ct_tuplehash_to_ctrack(h);
|
||||
|
||||
skb->nfct = &ct->ct_general;
|
||||
skb->nfctinfo = ovs_ct_get_info(h);
|
||||
nf_ct_set(skb, ct, ovs_ct_get_info(h));
|
||||
return ct;
|
||||
}
|
||||
|
||||
@@ -724,8 +723,7 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
|
||||
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;
|
||||
nf_ct_set(skb, tmpl, IP_CT_NEW);
|
||||
}
|
||||
|
||||
err = nf_conntrack_in(net, info->family,
|
||||
|
Reference in New Issue
Block a user