From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft] netlink_delinearize: remove integer_type_postprocess()
Date: Sat, 25 Feb 2017 12:08:34 +0100 [thread overview]
Message-ID: <1488020914-23192-1-git-send-email-pablo@netfilter.org> (raw)
Not required anymore since the set definition now comes with the right
byteorder for integer types via NFTA_SET_USERDATA area. So we don't need
to look at the lhs anymore. Note that this was a workaround that does
not work with named sets, where we cannot assume we have a lhs, since
it is valid to have a named set that is not referenced from any rule.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/netlink_delinearize.c | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index 90553836be79..57b8fa5127e5 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -1277,33 +1277,6 @@ struct stmt *netlink_parse_set_expr(const struct set *set,
static void expr_postprocess(struct rule_pp_ctx *ctx, struct expr **exprp);
-static void integer_type_postprocess(struct expr *expr)
-{
- struct expr *i;
-
- switch (expr->ops->type) {
- case EXPR_VALUE:
- if (expr->byteorder == BYTEORDER_HOST_ENDIAN) {
- uint32_t len = div_round_up(expr->len, BITS_PER_BYTE);
-
- mpz_switch_byteorder(expr->value, len);
- }
- break;
- case EXPR_SET_REF:
- list_for_each_entry(i, &expr->set->init->expressions, list) {
- expr_set_type(i, expr->dtype, expr->byteorder);
- integer_type_postprocess(i);
- }
- break;
- case EXPR_SET_ELEM:
- expr_set_type(expr->key, expr->dtype, expr->byteorder);
- integer_type_postprocess(expr->key);
- break;
- default:
- break;
- }
-}
-
static void payload_match_expand(struct rule_pp_ctx *ctx,
struct expr *expr,
struct expr *payload)
@@ -1392,8 +1365,6 @@ static void ct_meta_common_postprocess(const struct expr *expr)
break;
case OP_LOOKUP:
expr_set_type(right, left->dtype, left->byteorder);
- if (right->dtype == &integer_type)
- integer_type_postprocess(right);
break;
default:
--
2.1.4
reply other threads:[~2017-02-25 11:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1488020914-23192-1-git-send-email-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 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).