diff options
author | Patrick McHardy <kaber@trash.net> | 2015-03-23 23:36:35 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2015-03-23 23:36:35 +0000 |
commit | def2cca8e713d2dcbed3b2b3fa44d4e56d193674 (patch) | |
tree | 709c23dbcdf51155edb1cfa62e047e96e666abb6 /src | |
parent | a4e3c42048e8d6ca0635b498c6b8ae6db9e16b1b (diff) |
set_elem: convert flag value to inclusive-OR binops during delinearize
When a set contains combined flag values, they are displayed as numeric
value since they don't match any of the single flag values:
tcp flags { 18, psh, syn}
Convert to a series of inclusive-OR binops of the single flag values
for improved readability:
tcp flags { syn | ack, psh, syn}
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/netlink.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c index bd6aa939..24dda67c 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -1383,6 +1383,10 @@ static int netlink_delinearize_setelem(struct nft_set_elem *nlse, expr->byteorder == BYTEORDER_HOST_ENDIAN) mpz_switch_byteorder(expr->value, expr->len / BITS_PER_BYTE); + if (expr->dtype->basetype != NULL && + expr->dtype->basetype->type == TYPE_BITMASK) + expr = bitmask_expr_to_binops(expr); + if (flags & NFT_SET_ELEM_INTERVAL_END) { expr->flags |= EXPR_F_INTERVAL_END; } else { |