From: Pablo Neira Ayuso Date: Thu, 21 Jul 2016 17:14:13 +0000 (+0200) Subject: expr: lookup: print flags only if they are available X-Git-Tag: libnftnl-1.0.7~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bbe39497df8055dd47ddf152e50d53634c051be;p=thirdparty%2Flibnftnl.git 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 --- diff --git a/src/expr/lookup.c b/src/expr/lookup.c index 16cfce21..97478c25 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; }