From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Antonio Ojea <antonio.ojea.garcia@gmail.com>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nfnetlink_queue: reroute reinjected packets from postrouting
Date: Wed, 18 Sep 2024 10:42:02 +0200 [thread overview]
Message-ID: <20240918084202.GA10401@breakpoint.cc> (raw)
In-Reply-To: <ZuqPnLVqbQK6T_th@calendula>
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.
next prev parent reply other threads:[~2024-09-18 8:42 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 [this message]
2024-09-18 9:51 ` Antonio Ojea
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=20240918084202.GA10401@breakpoint.cc \
--to=fw@strlen.de \
--cc=antonio.ojea.garcia@gmail.com \
--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).