From 0e90798e98121abab274434ec60f0b873f510021 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 24 Aug 2018 09:52:17 +0200 Subject: src: simplify map statement Instead of using the map expression, store dynamic key and data separately since they need special handling than constant maps. Signed-off-by: Pablo Neira Ayuso --- src/statement.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/statement.c') diff --git a/src/statement.c b/src/statement.c index cec83c19..039ca943 100644 --- a/src/statement.c +++ b/src/statement.c @@ -657,15 +657,16 @@ static void map_stmt_print(const struct stmt *stmt, struct output_ctx *octx) nft_print(octx, "%s ", set_stmt_op_names[stmt->map.op]); expr_print(stmt->map.set, octx); nft_print(octx, " { "); - expr_print(stmt->map.map->map->key, octx); + expr_print(stmt->map.key, octx); nft_print(octx, " : "); - expr_print(stmt->map.map->mappings, octx); + expr_print(stmt->map.data, octx); nft_print(octx, " }"); } static void map_stmt_destroy(struct stmt *stmt) { - expr_free(stmt->map.map); + expr_free(stmt->map.key); + expr_free(stmt->map.data); expr_free(stmt->map.set); } -- cgit v1.2.3