All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org, Balazs Gulacsi <m2gulbal@gmail.com>
Subject: Re: [iptables PATCH] extensions: libxt_conntrack: Fail on untranslatable state match
Date: Wed, 21 Oct 2026 12:31:08 +0200	[thread overview]
Message-ID: <atiUbF-5aXoKdpJk@chamomile> (raw)
In-Reply-To: <atiRNbVh-1ELNyDX@orbyte.nwl.cc>

Hi Phil,

On Wed, Oct 21, 2026 at 12:17:25PM +0200, Phil Sutter wrote:
> On Thu, Oct 08, 2026 at 08:23:51PM +0200, Phil Sutter wrote:
> > Iptables' conntrack match supports combined matching on ct->state bits
> > as well as the NAT bits in ct->status. The kernel extension matches if
> > any of the bits is set, i.e. '-m conntrack --ctstate NEW,DNAT' matches
> > packets in either NEW state or DNAT status or both. Therefore,
> > translating this sample match into 'ct status dnat ct state new' is
> > wrong: The nftables rule matches only if both statements match.
> > 
> > The only way to achieve this in nftables seems to be by duplicating the
> > rule which is not feasible within the xlate infrastructure. So instead
> > just abort the translation.
> > 
> > This is a partial revert of commit 1a13277f88099 ("extensions:
> > libxt_conntrack: Fix for ignored ctstates in translation") which turned
> > an incomplete translation into an incorrect one.
> > 
> > Cc: Balazs Gulacsi <m2gulbal@gmail.com>
> > Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1826
> > Fixes: 26ec09bf6b9b6 ("extensions: libxt_conntrack: provide translation for DNAT and SNAT --ctstate")
> > Signed-off-by: Phil Sutter <phil@nwl.cc>
> 
> Patch applied.

Thanks.

I wonder if it is worth filling the gap and expose snat and dnat
through ct state in nftables.

This will take time to propagate before we can expose it via userspace
(we have here the dilemma of exposing a feature which would be not
available in old kernel, but it would in newer ones... without having
an easy way to reject from control plane given the cmp and lookup
expressions do not have context on the acceptables values.

Such patch should be relatively small.

  reply	other threads:[~2026-10-21 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 18:23 [iptables PATCH] extensions: libxt_conntrack: Fail on untranslatable state match Phil Sutter
2026-10-21 10:17 ` Phil Sutter
2026-10-21 10:31   ` Pablo Neira Ayuso [this message]
2026-10-21 13:40     ` Phil Sutter

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=atiUbF-5aXoKdpJk@chamomile \
    --to=pablo@netfilter.org \
    --cc=m2gulbal@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.