diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-12-05 23:35:49 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-12-07 13:31:02 +0100 |
commit | 37df5301a3ae903c5b1aa90cae37c6c669dfc386 (patch) | |
tree | dfaf6fdbc51c03f4f788a825d643fa85d7b9a3d2 /net/netfilter/nft_set_rbtree.c | |
parent | 1a37ef769d68d2719a9a418bd80fc42d19259b24 (diff) | |
download | op-kernel-dev-37df5301a3ae903c5b1aa90cae37c6c669dfc386.zip op-kernel-dev-37df5301a3ae903c5b1aa90cae37c6c669dfc386.tar.gz |
netfilter: nft_set: introduce nft_{hash, rbtree}_deactivate_one()
This new function allows us to deactivate one single element, this is
required by the set flush command that comes in a follow up patch.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_set_rbtree.c')
-rw-r--r-- | net/netfilter/nft_set_rbtree.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c index 36493a7..5580bb6 100644 --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -171,6 +171,15 @@ static void nft_rbtree_activate(const struct net *net, nft_set_elem_change_active(net, set, &rbe->ext); } +static bool nft_rbtree_deactivate_one(const struct net *net, + const struct nft_set *set, void *priv) +{ + struct nft_rbtree_elem *rbe = priv; + + nft_set_elem_change_active(net, set, &rbe->ext); + return true; +} + static void *nft_rbtree_deactivate(const struct net *net, const struct nft_set *set, const struct nft_set_elem *elem) @@ -204,7 +213,7 @@ static void *nft_rbtree_deactivate(const struct net *net, parent = parent->rb_right; continue; } - nft_set_elem_change_active(net, set, &rbe->ext); + nft_rbtree_deactivate_one(net, set, rbe); return rbe; } } |