netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org, fw@strlen.de
Subject: Re: [iptables PATCH v2 2/2] extensions: libxt_conntrack: print xlate status as set
Date: Tue, 30 Mar 2021 19:39:00 +0200	[thread overview]
Message-ID: <20210330173900.GB17285@breakpoint.cc> (raw)
In-Reply-To: <20210330141524.747259-2-alexander.mikhalitsyn@virtuozzo.com>

Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com> wrote:
> status_xlate_print function prints statusmask
> without { ... } around. But if ctstatus condition is
> negative, then we have to use { ... } after "!=" operator in nft

Not really.

> Reproducer:
> $ iptables -A INPUT -d 127.0.0.1/32 -p tcp -m conntrack ! --ctstatus expected,assured -j DROP
> $ nft list ruleset
> ...
> meta l4proto tcp ip daddr 127.0.0.1 ct status != expected,assured counter packets 0 bytes 0 drop
> ...

Yes, nft can't parse that.

But ct status { expect, assured } is NOT The same as 'ct status expect,assured'.

expect, assured etc. are all bit flags, so when negating this needs to be something
like  'ct status & (expected|assured) == 0'. (ct is neither expected nor assured).

  reply	other threads:[~2021-03-30 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 14:15 [iptables PATCH v2 1/2] extensions: libxt_conntrack: print xlate state as set Alexander Mikhalitsyn
2021-03-30 14:15 ` [iptables PATCH v2 2/2] extensions: libxt_conntrack: print xlate status " Alexander Mikhalitsyn
2021-03-30 17:39   ` Florian Westphal [this message]
2021-03-30 18:05     ` Alexander Mikhalitsyn
2021-03-30 18:21       ` Florian Westphal
2021-03-31 10:31         ` Alexander Mikhalitsyn

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=20210330173900.GB17285@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=alexander.mikhalitsyn@virtuozzo.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).