From be9bd9cc7288477e54bef0225321ffa72b409116 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 27 Jul 2021 17:23:27 +0200 Subject: expression: missing != in flagcmp expression print function Missing != when printing the expression. Fixes: c3d57114f119 ("parser_bison: add shortcut syntax for matching flags without binary operations") Signed-off-by: Pablo Neira Ayuso --- src/expression.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/expression.c b/src/expression.c index c6be0001..4c0874fe 100644 --- a/src/expression.c +++ b/src/expression.c @@ -1358,7 +1358,12 @@ struct expr *set_elem_catchall_expr_alloc(const struct location *loc) static void flagcmp_expr_print(const struct expr *expr, struct output_ctx *octx) { expr_print(expr->flagcmp.expr, octx); - nft_print(octx, " "); + + if (expr->op == OP_NEQ) + nft_print(octx, " != "); + else + nft_print(octx, " "); + expr_print(expr->flagcmp.value, octx); nft_print(octx, " / "); expr_print(expr->flagcmp.mask, octx); -- cgit v1.2.3