summaryrefslogtreecommitdiffstats
path: root/src/meta.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-03-20 16:12:18 +0100
committerPatrick McHardy <kaber@trash.net>2009-03-20 16:12:18 +0100
commit1bd3b87687328e1e097ca69cf18f2f14abfa9782 (patch)
tree5da11e82f3b32151afec78f7d216a25a39d0c429 /src/meta.c
parentb076d6c6376a77fa84aa813bf267628820bcc883 (diff)
expr: add support for cloning expressions
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/meta.c')
-rw-r--r--src/meta.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/meta.c b/src/meta.c
index cb9e495c..5998d09c 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -305,10 +305,16 @@ static void meta_expr_print(const struct expr *expr)
printf("meta %s", meta_templates[expr->meta.key].token);
}
+static void meta_expr_clone(struct expr *new, const struct expr *expr)
+{
+ new->meta.key = expr->meta.key;
+}
+
static const struct expr_ops meta_expr_ops = {
.type = EXPR_META,
.name = "meta",
.print = meta_expr_print,
+ .clone = meta_expr_clone,
};
struct expr *meta_expr_alloc(const struct location *loc, enum nft_meta_keys key)