summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-02-16 20:35:37 +0000
committerPatrick McHardy <kaber@trash.net>2014-02-17 17:17:18 +0000
commit5a140c9cf95724f971ec9cb40217bea8fc4d089f (patch)
tree19733bb86ac658978291abeb5139a8d1de156b90 /include
parent6bad82aba5d304c7a2dd1b19fe57464dca327f4a (diff)
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 <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r--include/expression.h2
1 files changed, 2 insertions, 0 deletions
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[];