]> git.baikalelectronics.ru Git - kernel.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)
commit5df0dadd8e6824490baa1421d472efddebc172aa
treefa407ecfed9a114ab113e17ae064da61c02d2d58
parent8f18967828185818720791d02c29925c9b27025b
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: 4a4835e91e03 ("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