]> 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)
commit186a0804f973e78e275822f32a3f90377c59a07c
treefa407ecfed9a114ab113e17ae064da61c02d2d58
parentb5deef99c6be882be9eed237bcb0abe0293f109c
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: 14793e629b67 ("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