summaryrefslogtreecommitdiffstats
path: root/src/meta.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-02-08 17:02:23 +0100
committerFlorian Westphal <fw@strlen.de>2019-02-08 21:26:16 +0100
commite3f195777ee54c7a57aab932b64c6ecbd782f68f (patch)
treef1336d55e55529df44d01c47f8fefd0b844bdfa8 /src/meta.c
parent72931553828af0ce85f0562b9ff8ec7f4d28e050 (diff)
src: expr: remove expr_ops from struct expr
size of struct expr changes from 144 to 128 bytes on x86_64. This doesn't look like much, but large rulesets can have tens of thousands of expressions (each set element is represented by an expression). Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/meta.c')
-rw-r--r--src/meta.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/meta.c b/src/meta.c
index 4cb91773..7e44a2a3 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -553,7 +553,7 @@ static void meta_expr_pctx_update(struct proto_ctx *ctx,
}
}
-static const struct expr_ops meta_expr_ops = {
+const struct expr_ops meta_expr_ops = {
.type = EXPR_META,
.name = "meta",
.print = meta_expr_print,
@@ -568,7 +568,7 @@ struct expr *meta_expr_alloc(const struct location *loc, enum nft_meta_keys key)
const struct meta_template *tmpl = &meta_templates[key];
struct expr *expr;
- expr = expr_alloc(loc, &meta_expr_ops, tmpl->dtype,
+ expr = expr_alloc(loc, EXPR_META, tmpl->dtype,
tmpl->byteorder, tmpl->len);
expr->meta.key = key;