Do not print stateful information such as counters which are likely set
to zero.
Before this patch:
Merging:
packets.conf:10:3-29: ip protocol 4 counter drop
packets.conf:11:3-29: ip protocol 41 counter drop
packets.conf:12:3-29: ip protocol 47 counter drop
into:
ip protocol { 4, 41, 47 } counter packets 0 bytes 0 drop
^^^^^^^^^^^^^^^^^
After:
Merging:
packets.conf:10:3-29: ip protocol 4 counter drop
packets.conf:11:3-29: ip protocol 41 counter drop
packets.conf:12:3-29: ip protocol 47 counter drop
into:
ip protocol { 4, 41, 47 } counter drop
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
assert(0);
}
+ octx->flags |= NFT_CTX_OUTPUT_STATELESS;
+
fprintf(octx->error_fp, "Merging:\n");
rule_optimize_print(octx, ctx->rule[from]);
fprintf(octx->error_fp, "into:\n\t");
rule_print(ctx->rule[from], octx);
fprintf(octx->error_fp, "\n");
+
+ octx->flags &= ~NFT_CTX_OUTPUT_STATELESS;
}
static bool stmt_type_eq(const struct stmt *stmt_a, const struct stmt *stmt_b)