diff options
authorYanchuan Nian <>2014-06-19 20:23:47 +0800
committerPablo Neira Ayuso <>2014-06-25 14:13:03 +0200
commit2a96066f56cb007711d70ac2e60415f0c86f4233 (patch)
parent6b39cecf634ade76ae6b19c632ef5890639481cb (diff)
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 counter You can also give the initial values of packets and bytes. % nft add rule filter output ip daddr 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 <>
1 files changed, 1 insertions, 1 deletions
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);