From 5a140c9cf95724f971ec9cb40217bea8fc4d089f Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sun, 16 Feb 2014 20:35:37 +0000 Subject: binop: take care of operator precedence when printing binop arguments When the argument of a binop is a binop itself, we may need to add parens if the precedence of the argument is lower then the binop. Before: tcp flags & syn | ack == syn | ack tcp flags & syn | ack != syn | ack After: tcp flags & (syn | ack) == syn | ack tcp flags & (syn | ack) != syn | ack Signed-off-by: Patrick McHardy --- include/expression.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/expression.h') diff --git a/include/expression.h b/include/expression.h index 0633102e..5128a5bb 100644 --- a/include/expression.h +++ b/include/expression.h @@ -80,7 +80,9 @@ enum ops { OP_FLAGCMP, /* Set lookup */ OP_LOOKUP, + __OP_MAX }; +#define OP_MAX (__OP_MAX - 1) extern const char *expr_op_symbols[]; -- cgit v1.2.3