From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net, fw@strlen.de
Subject: [PATCH nft 3/7] netlink_delinearize: postprocess expression before range merge
Date: Sat, 5 Dec 2015 20:04:22 +0100 [thread overview]
Message-ID: <1449342266-2756-3-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1449342266-2756-1-git-send-email-pablo@netfilter.org>
Dependency statement go away after postprocess, so we should consider
them for possible range merges.
This problem was uncovered when adding support for sub-byte payload
ranges.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/netlink_delinearize.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index e5cee16..8cbabc3 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -1558,11 +1558,11 @@ static void stmt_expr_postprocess(struct rule_pp_ctx *ctx, struct stmt *prev)
{
enum ops op;
- if (prev && ctx->stmt->ops->type == prev->ops->type &&
+ expr_postprocess(ctx, &ctx->stmt->expr);
+
+ if (prev && ctx->stmt && ctx->stmt->ops->type == prev->ops->type &&
expr_may_merge_range(ctx->stmt->expr, prev->expr, &op))
expr_postprocess_range(ctx, prev, op);
-
- expr_postprocess(ctx, &ctx->stmt->expr);
}
static void rule_parse_postprocess(struct netlink_parse_ctx *ctx, struct rule *rule)
--
2.1.4
next prev parent reply other threads:[~2015-12-05 19:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 19:04 [PATCH nft 1/7,v2] tests: vlan pcp and cfi are located in the first byte Pablo Neira Ayuso
2015-12-05 19:04 ` [PATCH nft 2/7,v2] src: fix sub-byte protocol header definitions Pablo Neira Ayuso
2015-12-14 17:38 ` Pablo Neira Ayuso
2015-12-05 19:04 ` Pablo Neira Ayuso [this message]
2015-12-05 19:04 ` [PATCH nft 4/7] evaluate: transfer right shifts to constant side Pablo Neira Ayuso
2015-12-05 19:04 ` [PATCH nft 5/7] evaluate: transfer right shifts to range side Pablo Neira Ayuso
2015-12-05 19:04 ` [PATCH nft 6/7] evaluate: transfer right shifts to set reference side Pablo Neira Ayuso
2015-12-05 19:04 ` [PATCH nft 7/7] src: move payload sub-byte matching to the evaluation step 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=1449342266-2756-3-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=kaber@trash.net \
--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 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).