From: Antonio Ojea <antonio.ojea.garcia@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nfnetlink_queue: reroute reinjected packets from postrouting
Date: Wed, 18 Sep 2024 10:51:30 +0100 [thread overview]
Message-ID: <CABhP=taCqWu5JSmZp+cF+p-=cDsbnQXpBU+ZR1v6238yC1pdmQ@mail.gmail.com> (raw)
In-Reply-To: <20240918084202.GA10401@breakpoint.cc>
On Wed, 18 Sept 2024 at 09:42, Florian Westphal <fw@strlen.de> wrote:
>
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > > Ok, I finally managed to get this tested, and it does not seem to
> > > solve the problem, it keeps dnating twice after the packet is enqueued
> > > by nfqueue
> >
> > dnatting twice is required to deal with the conntrack confirmation race.
>
> Antonio could also try this hack:
>
> diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
> --- a/net/netfilter/nfnetlink_queue.c
> +++ b/net/netfilter/nfnetlink_queue.c
> @@ -379,7 +379,7 @@ static void nfqnl_reinject(struct nf_queue_entry *entry, unsigned int verdict)
> unsigned int ct_verdict = verdict;
>
> rcu_read_lock();
> - ct_hook = rcu_dereference(nf_ct_hook);
> + ct_hook = NULL;
> if (ct_hook)
> ct_verdict = ct_hook->update(entry->state.net, entry->skb);
> rcu_read_unlock();
>
> which defers this to the clash resolution logic.
> The ct_hook->update infra predates this, I'm not sure we need
> it anymore.
Awesome, it works perfectly
I have these patches in addition to this last one
c3d69b2c40bb selftests: netfilter: add reverse-clash resolution test case
fd7c45a0aa7a netfilter: conntrack: add clash resolution for reverse collisions
8bb12723d1c4 netfilter: nf_nat: don't try nat source port reallocation
for reverse dir clash
It works with and without 610cea0d00f8 netfilter: nfnetlink_queue:
reroute reinjected packets from postrouting
next prev parent reply other threads:[~2024-09-18 9:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 18:58 [PATCH nf] netfilter: nfnetlink_queue: reroute reinjected packets from postrouting Pablo Neira Ayuso
2024-09-13 6:24 ` Antonio Ojea
2024-09-17 22:01 ` Antonio Ojea
2024-09-18 8:30 ` Pablo Neira Ayuso
2024-09-18 8:42 ` Florian Westphal
2024-09-18 9:51 ` Antonio Ojea [this message]
2024-09-18 9:54 ` Florian Westphal
2024-09-18 20:53 ` Pablo Neira Ayuso
2024-09-18 21:42 ` Antonio Ojea
2024-09-19 12:02 ` Pablo Neira Ayuso
2024-10-06 14:44 ` Antonio Ojea
2024-10-07 8:14 ` Antonio Ojea
2024-10-07 8:30 ` Pablo Neira Ayuso
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='CABhP=taCqWu5JSmZp+cF+p-=cDsbnQXpBU+ZR1v6238yC1pdmQ@mail.gmail.com' \
--to=antonio.ojea.garcia@gmail.com \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).