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 v3 1/2] extensions: libxt_conntrack: print xlate state as set
Date: Wed, 31 Mar 2021 13:01:53 +0200	[thread overview]
Message-ID: <20210331110153.GE17285@breakpoint.cc> (raw)
In-Reply-To: <20210331102934.848126-1-alexander.mikhalitsyn@virtuozzo.com>

Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com> wrote:
> Currently, state_xlate_print function prints statemask
> without { ... } around. But if ctstate condition is
> negative, then we have to use { ... } after "!=" operator
> 
> Reproducer:
> $ iptables -A INPUT -d 127.0.0.1/32 -p tcp -m conntrack ! --ctstate RELATED,ESTABLISHED -j DROP
> $ nft list ruleset
> ...
> meta l4proto tcp ip daddr 127.0.0.1 ct state != related,established counter packets 0 bytes 0 drop
> ...
> 
> it will fail if we try to load this rule:
> $ nft -f nft_test
> ../nft_test:6:97-97: Error: syntax error, unexpected comma, expecting newline or semicolon

I'd suggest to use the 'foo & 1' notation just like for patch 2, it
avoids the set lookup.

      parent reply	other threads:[~2021-03-31 11:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 10:29 [iptables PATCH v3 1/2] extensions: libxt_conntrack: print xlate state as set Alexander Mikhalitsyn
2021-03-31 10:29 ` [iptables PATCH v3 2/2] extensions: libxt_conntrack: print xlate status " Alexander Mikhalitsyn
2021-03-31 10:58   ` Florian Westphal
2021-03-31 13:05     ` Alexander Mikhalitsyn
2021-03-31 11:01 ` Florian Westphal [this message]

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=20210331110153.GE17285@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).