[nftables PATCH] Correct initial value of bytes counter in nftables rule

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

 



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@xxxxxxxxx>
---
 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 b0ca241..222d102 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);
 }
-- 
1.9.3

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