]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
netfilter: nf_tables: Fix nft limit burst handling
authorandy zhou <azhou@ovn.org>
Mon, 21 Aug 2017 19:38:53 +0000 (12:38 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 24 Aug 2017 14:23:17 +0000 (16:23 +0200)
commitc26844eda9d4fdbd266660e3b3de2d0270e3a1ed
treefa407ecfed9a114ab113e17ae064da61c02d2d58
parentab6dd1beac7be3c17f8bf3d38bdf29ecb7293f1e
netfilter: nf_tables: Fix nft limit burst handling

Current implementation treats the burst configuration the same as
rate configuration. This can cause the per packet cost to be lower
than configured. In effect, this bug causes the token bucket to be
refilled at a higher rate than what user has specified.

This patch changes the implementation so that the token bucket size
is controlled by "rate + burst", while maintain the token bucket
refill rate the same as user specified.

Fixes: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_limit.c