From: Patrick McHardy Date: Sun, 16 Feb 2014 22:47:40 +0000 (+0000) Subject: evaluate: use flagcmp for single RHS bitmask expression X-Git-Tag: v0.2~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6bad82aba5d304c7a2dd1b19fe57464dca327f4a;p=thirdparty%2Fnftables.git 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 --- 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; } }