From 6bad82aba5d304c7a2dd1b19fe57464dca327f4a Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sun, 16 Feb 2014 22:47:40 +0000 Subject: evaluate: use flagcmp for single RHS bitmask expression Always use flagcmp for RHS bitmask expressions, independant of whether only one or an entire list of bitmask expression is specified. This makes sure that f.i. "tcp flags ack" will match any combinations of ACK instead of ACK and only ACK. Signed-off-by: Patrick McHardy --- src/evaluate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/evaluate.c b/src/evaluate.c index 8e51a63b..f10d0d98 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -885,7 +885,11 @@ static int expr_evaluate_relational(struct eval_ctx *ctx, struct expr **expr) rel->op = OP_FLAGCMP; break; default: - rel->op = OP_EQ; + if (right->dtype->basetype != NULL && + right->dtype->basetype->type == TYPE_BITMASK) + rel->op = OP_FLAGCMP; + else + rel->op = OP_EQ; break; } } -- cgit v1.2.3