From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Eric Woudstra <ericwouds@gmail.com>
Cc: Jozsef Kadlecsik <kadlec@netfilter.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v3 nf-next 3/3] netfilter: nf_flow_table_ip: don't follow fastpath when marked teardown
Date: Mon, 8 Sep 2025 23:06:11 +0200 [thread overview]
Message-ID: <aL9FQ47keDNxygQw@calendula> (raw)
In-Reply-To: <20250617070007.23812-4-ericwouds@gmail.com>
On Tue, Jun 17, 2025 at 09:00:07AM +0200, Eric Woudstra wrote:
> When a flow is marked for teardown, because the destination is not valid
> any more, the software fastpath may still be in effect and traffic is
> still send to the wrong destination. Change the ip/ipv6 hooks to not use
> the software fastpath for a flow that is marked to be teared down and let
> the packet continue along the normal path.
>
> Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
> ---
> net/netfilter/nf_flow_table_ip.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
> index 64a12b9668e7..f9bf2b466ca8 100644
> --- a/net/netfilter/nf_flow_table_ip.c
> +++ b/net/netfilter/nf_flow_table_ip.c
> @@ -542,6 +542,9 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
> dir = tuplehash->tuple.dir;
> flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
>
> + if (test_bit(NF_FLOW_TEARDOWN, &flow->flags))
> + return NF_ACCEPT;
nf_flow_offload_lookup() already checks for this bit, I don't a
benefit from this re-check.
next prev parent reply other threads:[~2025-09-08 21:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 7:00 [PATCH v3 nf-next 0/3] flow offload teardown when layer 2 roaming Eric Woudstra
2025-06-17 7:00 ` [PATCH v3 nf-next 1/3] netfilter: flow: Add bridge_vid member Eric Woudstra
2025-06-17 7:00 ` [PATCH v3 nf-next 2/3] netfilter: nf_flow_table_core: teardown direct xmit when destination changed Eric Woudstra
2025-09-08 21:56 ` Florian Westphal
2025-06-17 7:00 ` [PATCH v3 nf-next 3/3] netfilter: nf_flow_table_ip: don't follow fastpath when marked teardown Eric Woudstra
2025-09-08 21:06 ` Pablo Neira Ayuso [this message]
2025-09-02 8:58 ` [PATCH v3 nf-next 0/3] flow offload teardown when layer 2 roaming Eric Woudstra
2025-09-02 12:32 ` Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aL9FQ47keDNxygQw@calendula \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ericwouds@gmail.com \
--cc=horms@kernel.org \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).