netfilter: nft_quota: dump consumed quota
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 27 Nov 2016 23:05:52 +0000 (00:05 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 7 Dec 2016 11:54:22 +0000 (12:54 +0100)
commit795595f68d6c787028345804bb06f5a633af24a2
tree37a41411dd3ff65cbb8098626ce61870da48098d
parentc97d22e68bfedfacb9e752dee536c69916ae0933
netfilter: nft_quota: dump consumed quota

Add a new attribute NFTA_QUOTA_CONSUMED that displays the amount of
quota that has been already consumed. This allows us to restore the
internal state of the quota object between reboots as well as to monitor
how wasted it is.

This patch changes the logic to account for the consumed bytes, instead
of the bytes that remain to be consumed.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/nf_tables.h
net/netfilter/nft_quota.c