From: Álvaro Neira Ayuso <alvaroneay@xxxxxxxxx> Fixed display compat_proto value and compat_flag if available Signed-off-by: Alvaro Neira Ayuso <alvaroneay@xxxxxxxxx> --- src/rule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rule.c b/src/rule.c index 9d6a996..41534bd 100644 --- a/src/rule.c +++ b/src/rule.c @@ -633,9 +633,10 @@ static int nft_rule_snprintf_json(char *buf, size_t size, struct nft_rule *r, r->rule_flags); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - if(NFT_RULE_ATTR_COMPAT_PROTO != 0 || NFT_RULE_ATTR_COMPAT_FLAGS != 0){ + if (r->flags & (1 << NFT_RULE_ATTR_COMPAT_PROTO) || + r->flags & (1 << NFT_RULE_ATTR_COMPAT_FLAGS)) { ret = snprintf(buf+offset,len,"\"compat_flags\" : %u, " - "\"compat_proto\" : %u, ", + "\"compat_proto\" : %u, ", r->compat.flags, r->compat.proto); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); } -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html