]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: xt_quota: fix the behavior of xt_quota module
authorChenbo Feng <fengc@google.com>
Tue, 2 Oct 2018 01:23:08 +0000 (18:23 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 3 Oct 2018 09:32:54 +0000 (11:32 +0200)
commit81968184211aa563d8ed117900070b8ba214ee7b
tree5672a29c2e09dcd6d47837b9d79405efaae4f49a
parentb79a43173eca5b0a6ccf5f9a4c3bca0600682e16
netfilter: xt_quota: fix the behavior of xt_quota module

A major flaw of the current xt_quota module is that quota in a specific
rule gets reset every time there is a rule change in the same table. It
makes the xt_quota module not very useful in a table in which iptables
rules are changed at run time. This fix introduces a new counter that is
visible to userspace as the remaining quota of the current rule. When
userspace restores the rules in a table, it can restore the counter to
the remaining quota instead of resetting it to the full quota.

Signed-off-by: Chenbo Feng <fengc@google.com>
Suggested-by: Maciej Żenczykowski <maze@google.com>
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/xt_quota.h
net/netfilter/xt_quota.c