]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: add quota expression
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 17 Aug 2016 23:46:06 +0000 (01:46 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 22 Aug 2016 09:42:18 +0000 (11:42 +0200)
commit73c4545ce7c433286beff8e802b0296ec9ce6b9e
tree2b6b9df712759bfc4894fa679109a2d5d01a0629
parent17a41dc3bafedd84d870ebfddc40bc8cecdcba76
netfilter: nf_tables: add quota expression

This patch adds the quota expression. This new stateful expression
integrate easily into the dynset expression to build 'hashquota' flow
tables.

Arguably, we could use instead "counter bytes > 1000" instead, but this
approach has several problems:

1) We only support for one single stateful expression in dynamic set
   definitions, and the expression above is a composite of two
   expressions: get counter + comparison.

2) We would need to restore the packed counter representation (that we
   used to have) based on seqlock to synchronize this, since per-cpu is
   not suitable for this.

So instead of bloating the counter expression back with the seqlock
representation and extending the existing set infrastructure to make it
more complex for the composite described above, let's follow the more
simple approach of adding a quota expression that we can plug into our
existing infrastructure.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/nf_tables.h
net/netfilter/Kconfig
net/netfilter/Makefile
net/netfilter/nft_quota.c [new file with mode: 0644]