]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: rename recursion counter to recursion.binop
authorFlorian Westphal <fw@strlen.de>
Fri, 6 Jun 2025 12:12:36 +0000 (14:12 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 13 Aug 2025 18:10:05 +0000 (20:10 +0200)
commit3da5b12751576eec4fb564970c34c8dee3f4f8d2
treed5fed48184d05a9f316db76ced75b809d4e00ba2
parentb41162e54ee57aafd7fc5dfb19a4f977905abe11
evaluate: rename recursion counter to recursion.binop

commit 10b44319a53a131ed943e2b6eeb62d197178bf4d upstream.

The existing recursion counter is used by the binop expression to detect
if we've completely followed all the binops.

We can only chain up to NFT_MAX_EXPR_RECURSION binops, but the evaluation
step can perform constant-folding, so we must recurse until we found the
rightmost (last) binop in the chain.

Then we can check the post-eval chain to see if it is something that can
be serialized later (i.e., if we are within the NFT_MAX_EXPR_RECURSION
after constant folding) or not.

Thus we can't reuse the existing ctx->recursion counter for other
expressions; entering the initial expr_evaluate_binop with
ctx->recursion > 0 would break things.

Therefore rename this to an embedded structure.
This allows us to add a new recursion counter in a followup patch.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/rule.h
src/evaluate.c