netfilter: nft_rbtree: check for next generation when deactivating elements
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 20 Jun 2016 22:12:15 +0000 (00:12 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Jun 2016 09:03:26 +0000 (11:03 +0200)
set->ops->deactivate() is invoked from nft_del_setelem() that happens
from the transaction path, so we have to check if the object is active
in the next generation, not the current.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_rbtree.c

index f762094af7c1ca7e7684448381e7e49ee430045e..86fbe5e68d28794fd6a22755c8eaefb05b26ee74 100644 (file)
@@ -170,7 +170,7 @@ static void *nft_rbtree_deactivate(const struct nft_set *set,
        const struct nft_rbtree *priv = nft_set_priv(set);
        const struct rb_node *parent = priv->root.rb_node;
        struct nft_rbtree_elem *rbe, *this = elem->priv;
-       u8 genmask = nft_genmask_cur(read_pnet(&set->pnet));
+       u8 genmask = nft_genmask_next(read_pnet(&set->pnet));
        int d;
 
        while (parent != NULL) {