From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft 2/2] evaluate: restrict allowed subtypes of concatenations
Date: Fri, 11 Apr 2025 11:44:29 +0200 [thread overview]
Message-ID: <Z_jkfafmlGedPQ-H@calendula> (raw)
In-Reply-To: <20250411055201.GA17742@breakpoint.cc>
On Fri, Apr 11, 2025 at 07:52:01AM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
[...]
> > Not related, but if goal is to provide context then I also need more
> > explicit context hints for bitfield payload and bitwise expressions
> > where the evaluation needs to be different depending on where the
> > expression is located (not the same if the expression is either used
> > as selector or as lhs/rhs of assignment).
> >
> > I don't know yet how such new context enum to modify evaluation
> > behaviour will look, so we can just use recursion.list by now, I don't
> > want to block this fix.
>
> OK. Yes, it would also work if there was some different "where am I"
> indicator, e.g. if (ctx->expr_side == CTX_EXPR_LHS) or whatever.
Exactly, something like this.
> This fix isn't urgent, we can keep it back and come back to this
> if you prefer to first work on the ctx hint extensions.
I am in the need for such a context for payload/meta statements.
meta mark set ip dscp map ...
^^^^^^^
in this case, ip dscp needs to be evaluated as a key for lookups,
shift can probably be removed for implicit maps.
While in this case:
meta mark set ip dscp
^^^^^^^
in this case, ip dscp needs the shift.
Then, there is:
ip dscp set meta mark
^^^^^^^
(note: this is not yet supported)
where ip dscp needs to expand to 16-bit because of the kernel
checksum routine requirements.
They are all payload expressions, but evaluation needs to be slightly
different depending on how the expression is used.
This context should help disentangle evaluation, evaluation is making
assumption based on subtle hints, I think there is a need for more
explicit hints.
We can revisit in a few weeks, otherwise take this.
next prev parent reply other threads:[~2025-04-11 9:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 14:50 [PATCH nft 1/2] evaluate: rename recursion counter to recursion.binop Florian Westphal
2025-04-02 14:50 ` [PATCH nft 2/2] evaluate: restrict allowed subtypes of concatenations Florian Westphal
2025-04-10 22:50 ` Pablo Neira Ayuso
2025-04-11 5:52 ` Florian Westphal
2025-04-11 9:44 ` Pablo Neira Ayuso [this message]
2025-04-11 9:48 ` 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=Z_jkfafmlGedPQ-H@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.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.