diff options
author | Patrick McHardy <kaber@trash.net> | 2015-03-25 14:08:50 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-03-26 11:09:35 +0100 |
commit | cc02e457bb86f7b6ffee3651bab22d104b60effb (patch) | |
tree | 49f656039fee513e2ae6eeba06e141993c15ab9f /net/ipv6 | |
parent | ea4bd995b0f2fc5677ff8085e92a5d2544b9937c (diff) | |
download | linux-cc02e457bb86f7b6ffee3651bab22d104b60effb.tar.gz linux-cc02e457bb86f7b6ffee3651bab22d104b60effb.tar.bz2 linux-cc02e457bb86f7b6ffee3651bab22d104b60effb.zip |
netfilter: nf_tables: implement set transaction support
Set elements are the last object type not supporting transaction support.
Implement similar to the existing rule transactions:
The global transaction counter keeps track of two generations, current
and next. Each element contains a bitmask specifying in which generations
it is inactive.
New elements start out as inactive in the current generation and active
in the next. On commit, the previous next generation becomes the current
generation and the element becomes active. The bitmask is then cleared
to indicate that the element is active in all future generations. If the
transaction is aborted, the element is removed from the set before it
becomes active.
When removing an element, it gets marked as inactive in the next generation.
On commit the next generation becomes active and the therefor the element
inactive. It is then taken out of then set and released. On abort, the
element is marked as active for the next generation again.
Lookups ignore elements not active in the current generation.
The current set types (hash/rbtree) both use a field in the extension area
to store the generation mask. This (currently) does not require any
additional memory since we have some free space in there.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv6')
0 files changed, 0 insertions, 0 deletions