All of lore.kernel.org
 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 2/2] extensions: libxt_conntrack: print xlate status as set
Date: Wed, 31 Mar 2021 12:58:52 +0200	[thread overview]
Message-ID: <20210331105852.GD17285@breakpoint.cc> (raw)
In-Reply-To: <20210331102934.848126-2-alexander.mikhalitsyn@virtuozzo.com>

Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com> wrote:
> At the moment, status_xlate_print function prints statusmask as comma-separated
> sequence of enabled statusmask flags. But if we have inverted conntrack ctstatus
> condition then we have to use more complex expression (if more than one flag enabled)
> because nft not supports syntax like "ct status != expected,assured".
> 
> Examples:
> ! --ctstatus CONFIRMED,ASSURED
> should be translated as
> ct status & (assured|confirmed) == 0
> 
> ! --ctstatus CONFIRMED
> can be translated as
> ct status != confirmed

"! --ctstatus CONFIRMED" means 'true if CONFIRMED bit is not set'
But "ct status != confirmed" means 'true if ct status contains any value
except confirmed.

Example: ct->status has confirmed and assured bits set.
Then:
"! --ctstatus CONFIRMED" won't match (the bit is set).
ct status != confirmed returns true (3 != 1)
ct (status & confirmed) == 0 won't match (the bit is set).


  reply	other threads:[~2021-03-31 10:59 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 [this message]
2021-03-31 13:05     ` Alexander Mikhalitsyn
2021-03-31 11:01 ` [iptables PATCH v3 1/2] extensions: libxt_conntrack: print xlate state " Florian Westphal

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=20210331105852.GD17285@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 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.