From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nftables 3/4] optimize: check for payload base and offset when searching for mergers
Date: Wed, 26 Jan 2022 23:33:13 +0100 [thread overview]
Message-ID: <20220126223314.297735-4-pablo@netfilter.org> (raw)
In-Reply-To: <20220126223314.297735-1-pablo@netfilter.org>
Extend the existing checks to cover the payload base and offset.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/optimize.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/optimize.c b/src/optimize.c
index 9a93e3b8d296..5882f3bd005d 100644
--- a/src/optimize.c
+++ b/src/optimize.c
@@ -40,6 +40,10 @@ static bool __expr_cmp(const struct expr *expr_a, const struct expr *expr_b)
switch (expr_a->etype) {
case EXPR_PAYLOAD:
+ if (expr_a->payload.base != expr_b->payload.base)
+ return false;
+ if (expr_a->payload.offset != expr_b->payload.offset)
+ return false;
if (expr_a->payload.desc != expr_b->payload.desc)
return false;
if (expr_a->payload.tmpl != expr_b->payload.tmpl)
--
2.30.2
next prev parent reply other threads:[~2022-01-26 22:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 22:33 [PATCH nftables 0/4] optimization updates Pablo Neira Ayuso
2022-01-26 22:33 ` [PATCH nftables 1/4] optimize: add __expr_cmp() Pablo Neira Ayuso
2022-01-26 22:33 ` [PATCH nftables 2/4] optimize: merge verdict maps with same lookup key Pablo Neira Ayuso
2022-01-26 22:33 ` Pablo Neira Ayuso [this message]
2022-01-26 22:33 ` [PATCH nftables 4/4] optimize: do not merge raw payload expressions Pablo Neira Ayuso
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=20220126223314.297735-4-pablo@netfilter.org \
--to=pablo@netfilter.org \
--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.