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 <ycnian@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
}
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);
}