diff options
author | Patrick McHardy <kaber@trash.net> | 2014-02-16 20:35:37 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-02-17 17:17:18 +0000 |
commit | 5a140c9cf95724f971ec9cb40217bea8fc4d089f (patch) | |
tree | 19733bb86ac658978291abeb5139a8d1de156b90 /include/expression.h | |
parent | 6bad82aba5d304c7a2dd1b19fe57464dca327f4a (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/expression.h')
-rw-r--r-- | include/expression.h | 2 |
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[]; |