OSDN Git Service

netfilter: nf_tables: prepare set element accounting for async updates
authorPatrick McHardy <kaber@trash.net>
Sun, 5 Apr 2015 12:41:06 +0000 (14:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 8 Apr 2015 14:58:27 +0000 (16:58 +0200)
commit3dd0673ac3cd7d05cde103396ec7ec410a901de2
tree4daf53c5aef7eade635652cd37c023fbd4e75bc1
parent4a8678efbec6b0ea46baafb77cd297e6e02da933
netfilter: nf_tables: prepare set element accounting for async updates

Use atomic operations for the element count to avoid races with async
updates.

To properly handle the transactional semantics during netlink updates,
deleted but not yet committed elements are accounted for seperately and
are treated as being already removed. This means for the duration of
a netlink transaction, the limit might be exceeded by the amount of
elements deleted. Set implementations must be prepared to handle this.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_hash.c