[PATCH libnftnl] chain: print usage counter for base chain via default output as well

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For some reason this was only printed in custom chains. Print it for
any chain, this is useful for debugging purposes.

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/chain.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/chain.c b/src/chain.c
index 2cc7c61..34eb91d 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -843,16 +843,16 @@ static int nft_chain_snprintf_default(char *buf, size_t size,
 {
 	int ret, len = size, offset = 0;
 
-	ret = snprintf(buf, len, "%s %s %s",
-		       nft_family2str(c->family), c->table, c->name);
+	ret = snprintf(buf, len, "%s %s %s use %u",
+		       nft_family2str(c->family), c->table, c->name, c->use);
 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
 	if (c->flags & (1 << NFT_CHAIN_ATTR_HOOKNUM)) {
 		ret = snprintf(buf+offset, len,
-			       " type %s hook %s prio %d policy %s use %d "
+			       " type %s hook %s prio %d policy %s "
 			       "packets %"PRIu64" bytes %"PRIu64"",
 			       c->type, nft_hooknum2str(c->family, c->hooknum),
-			       c->prio, nft_verdict2str(c->policy), c->use,
+			       c->prio, nft_verdict2str(c->policy),
 			       c->packets, c->bytes);
 		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 	}
-- 
1.7.10.4

--
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




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux