Its the same as nf_conntrack_put(), but without the need for an indirect call. The downside is a module dependency on nf_conntrack, but all of these already depend on conntrack anyway.
Showing the changes to net/openvswitch (1 of 3 files). Show all
Unified · Split
| @@ -574,7 +574,7 @@ ovs_ct_expect_find(struct net *net, const struct nf_conntrack_zone *zone, · 573 unmodified lines | ||
| 574 | 574 | struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h); |
| 575 | 575 | |
| 576 | 576 | nf_ct_delete(ct, 0, 0); |
| 577 | − nf_conntrack_put(&ct->ct_general); | |
| 577 | + nf_ct_put(ct); | |
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | 580 | |
| @@ -723,7 +723,7 @@ static bool skb_nfct_cached(struct net *net, · 142 unmodified lines | ||
| 723 | 723 | if (nf_ct_is_confirmed(ct)) |
| 724 | 724 | nf_ct_delete(ct, 0, 0); |
| 725 | 725 | |
| 726 | − nf_conntrack_put(&ct->ct_general); | |
| 726 | + nf_ct_put(ct); | |
| 727 | 727 | nf_ct_set(skb, NULL, 0); |
| 728 | 728 | return false; |
| 729 | 729 | } |
| @@ -967,7 +967,8 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, · 237 unmodified lines | ||
| 967 | 967 | |
| 968 | 968 | /* Associate skb with specified zone. */ |
| 969 | 969 | if (tmpl) { |
| 970 | − nf_conntrack_put(skb_nfct(skb)); | |
| 970 | + ct = nf_ct_get(skb, &ctinfo); | |
| 971 | + nf_ct_put(ct); | |
| 971 | 972 | nf_conntrack_get(&tmpl->ct_general); |
| 972 | 973 | nf_ct_set(skb, tmpl, IP_CT_NEW); |
| 973 | 974 | } |
| @@ -1328,7 +1329,12 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb, · 354 unmodified lines | ||
| 1328 | 1329 | |
| 1329 | 1330 | int ovs_ct_clear(struct sk_buff *skb, struct sw_flow_key *key) |
| 1330 | 1331 | { |
| 1331 | − nf_conntrack_put(skb_nfct(skb)); | |
| 1332 | + enum ip_conntrack_info ctinfo; | |
| 1333 | + struct nf_conn *ct; | |
| 1334 | + | |
| 1335 | + ct = nf_ct_get(skb, &ctinfo); | |
| 1336 | + | |
| 1337 | + nf_ct_put(ct); | |
| 1332 | 1338 | nf_ct_set(skb, NULL, IP_CT_UNTRACKED); |
| 1333 | 1339 | ovs_ct_fill_key(skb, key, false); |
| 1334 | 1340 | |