Commit d2792e91 authored by Yejune Deng's avatar Yejune Deng Committed by David S. Miller
Browse files

net: openvswitch: Remove unnecessary skb_nfct()



There is no need add 'if (skb_nfct(skb))' assignment, the
nf_conntrack_put() would check it.

Signed-off-by: default avatarYejune Deng <yejunedeng@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b7415964
Loading
Loading
Loading
Loading
+4 −7
Original line number Original line Diff line number Diff line
@@ -967,7 +967,6 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key,


		/* Associate skb with specified zone. */
		/* Associate skb with specified zone. */
		if (tmpl) {
		if (tmpl) {
			if (skb_nfct(skb))
			nf_conntrack_put(skb_nfct(skb));
			nf_conntrack_put(skb_nfct(skb));
			nf_conntrack_get(&tmpl->ct_general);
			nf_conntrack_get(&tmpl->ct_general);
			nf_ct_set(skb, tmpl, IP_CT_NEW);
			nf_ct_set(skb, tmpl, IP_CT_NEW);
@@ -1329,11 +1328,9 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb,


int ovs_ct_clear(struct sk_buff *skb, struct sw_flow_key *key)
int ovs_ct_clear(struct sk_buff *skb, struct sw_flow_key *key)
{
{
	if (skb_nfct(skb)) {
	nf_conntrack_put(skb_nfct(skb));
	nf_conntrack_put(skb_nfct(skb));
	nf_ct_set(skb, NULL, IP_CT_UNTRACKED);
	nf_ct_set(skb, NULL, IP_CT_UNTRACKED);
	ovs_ct_fill_key(skb, key, false);
	ovs_ct_fill_key(skb, key, false);
	}


	return 0;
	return 0;
}
}