From f9939f8954f800b865a0463c65f8c3e9a86aa296 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 17 Jun 2022 17:26:38 +0200 Subject: optimize: remove comment after merging Remove rule comment after merging rules, let the user decide if they want to reintroduce the comment in the ruleset file. Update optimizations/merge_stmt test. Signed-off-by: Pablo Neira Ayuso --- src/optimize.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/optimize.c b/src/optimize.c index b19a8b55..94242ee5 100644 --- a/src/optimize.c +++ b/src/optimize.c @@ -873,6 +873,11 @@ static void merge_rules(const struct optimize_ctx *ctx, assert(0); } + if (ctx->rule[from]->comment) { + xfree(ctx->rule[from]->comment); + ctx->rule[from]->comment = NULL; + } + octx->flags |= NFT_CTX_OUTPUT_STATELESS; fprintf(octx->error_fp, "Merging:\n"); -- cgit v1.2.3