diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-07-21 19:14:13 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-07-21 20:12:49 +0200 |
commit | 6bbe39497df8055dd47ddf152e50d53634c051be (patch) | |
tree | 490f0ae048ff9b65b13c27fa8a2b55eea5678af3 | |
parent | bda7102d60bfdab2aa3f36ebd09a119206f264d0 (diff) |
expr: lookup: print flags only if they are available
Follow same approach as with other objects, print what it is set only.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/expr/lookup.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expr/lookup.c b/src/expr/lookup.c index 16cfce2..97478c2 100644 --- a/src/expr/lookup.c +++ b/src/expr/lookup.c @@ -264,8 +264,10 @@ nftnl_expr_lookup_snprintf_default(char *buf, size_t size, SNPRINTF_BUFFER_SIZE(ret, size, len, offset); } - ret = snprintf(buf + offset, len, "0x%x ", l->flags); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + if (e->flags & (1 << NFTNL_EXPR_LOOKUP_FLAGS)) { + ret = snprintf(buf + offset, len, "0x%x ", l->flags); + SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + } return offset; } |