From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F5D3C433FE for ; Thu, 6 Oct 2022 14:19:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbiJFOTy (ORCPT ); Thu, 6 Oct 2022 10:19:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbiJFOTU (ORCPT ); Thu, 6 Oct 2022 10:19:20 -0400 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA2A4B1B90 for ; Thu, 6 Oct 2022 07:17:56 -0700 (PDT) Date: Thu, 6 Oct 2022 16:11:24 +0200 From: Pablo Neira Ayuso To: Xin Long Cc: network dev , dev@openvswitch.org, ovs-dev@openvswitch.org, davem@davemloft.net, kuba@kernel.org, Eric Dumazet , Paolo Abeni , Pravin B Shelar , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Florian Westphal , Marcelo Ricardo Leitner , Davide Caratti , Oz Shlomo , Paul Blakey , Ilya Maximets , Eelco Chaudron Subject: Re: [PATCH net-next 3/3] net: sched: add helper support in act_ct Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Oct 04, 2022 at 09:19:56PM -0400, Xin Long wrote: [...] > @@ -1119,6 +1135,22 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a, > if (err != NF_ACCEPT) > goto drop; > > + if (commit && p->helper && !nfct_help(ct)) { > + err = __nf_ct_try_assign_helper(ct, p->tmpl, GFP_ATOMIC); > + if (err) > + goto drop; > + add_helper = true; > + if (p->ct_action & TCA_CT_ACT_NAT && !nfct_seqadj(ct)) { > + if (!nfct_seqadj_ext_add(ct)) You can only add ct extensions if ct is !nf_ct_is_confirmed(ct)), is this guaranteed in this codepath? > + return -EINVAL; > + } > + } > + > + if (nf_ct_is_confirmed(ct) ? ((!cached && !skip_add) || add_helper) : commit) { > + if (nf_ct_helper(skb, family) != NF_ACCEPT) > + goto drop; > + } > + > if (commit) { > tcf_ct_act_set_mark(ct, p->mark, p->mark_mask); > tcf_ct_act_set_labels(ct, p->labels, p->labels_mask);