From 2a96066f56cb007711d70ac2e60415f0c86f4233 Mon Sep 17 00:00:00 2001 From: Yanchuan Nian Date: Thu, 19 Jun 2014 20:23:47 +0800 Subject: netlink: Correct initial value of bytes counter in nftables rule Packages can be accounted by nftables through such command. % nft add rule filter output ip daddr 8.8.8.8 counter You can also give the initial values of packets and bytes. % nft add rule filter output ip daddr 8.8.8.8 counter packets 10 bytes 20 But packets and bytes are both initialized to 10 in above command for there is a mistake in the program. Signed-off-by: Yanchuan Nian Signed-off-by: Pablo Neira Ayuso --- src/netlink_linearize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c index 8db333cc..5c1b46dd 100644 --- a/src/netlink_linearize.c +++ b/src/netlink_linearize.c @@ -545,7 +545,7 @@ static void netlink_gen_counter_stmt(struct netlink_linearize_ctx *ctx, } if (stmt->counter.bytes) { nft_rule_expr_set_u64(nle, NFT_EXPR_CTR_BYTES, - stmt->counter.packets); + stmt->counter.bytes); } nft_rule_add_expr(ctx->nlr, nle); } -- cgit v1.2.3