Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8427cae authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by Lee Jones
Browse files

UPSTREAM: netfilter: nf_tables: pass context to nft_set_destroy()



commit 0c2a85edd143162b3a698f31e94bf8cdc041da87 upstream.

The patch that adds support for stateful expressions in set definitions
require this.

Bug: 299922216
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e1eed9e0)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: Icd0339beda7c78b58caa7f77e5303ff3add7e4e6
parent 1ab45006
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -3852,7 +3852,7 @@ static int nf_tables_newset(struct net *net, struct sock *nlsk,
	return err;
}

static void nft_set_destroy(struct nft_set *set)
static void nft_set_destroy(const struct nft_ctx *ctx, struct nft_set *set)
{
	if (WARN_ON(set->use > 0))
		return;
@@ -4024,7 +4024,7 @@ EXPORT_SYMBOL_GPL(nf_tables_deactivate_set);
void nf_tables_destroy_set(const struct nft_ctx *ctx, struct nft_set *set)
{
	if (list_empty(&set->bindings) && nft_set_is_anonymous(set))
		nft_set_destroy(set);
		nft_set_destroy(ctx, set);
}
EXPORT_SYMBOL_GPL(nf_tables_destroy_set);

@@ -6717,7 +6717,7 @@ static void nft_commit_release(struct nft_trans *trans)
		nf_tables_rule_destroy(&trans->ctx, nft_trans_rule(trans));
		break;
	case NFT_MSG_DELSET:
		nft_set_destroy(nft_trans_set(trans));
		nft_set_destroy(&trans->ctx, nft_trans_set(trans));
		break;
	case NFT_MSG_DELSETELEM:
		nf_tables_set_elem_destroy(&trans->ctx,
@@ -7178,7 +7178,7 @@ static void nf_tables_abort_release(struct nft_trans *trans)
		nf_tables_rule_destroy(&trans->ctx, nft_trans_rule(trans));
		break;
	case NFT_MSG_NEWSET:
		nft_set_destroy(nft_trans_set(trans));
		nft_set_destroy(&trans->ctx, nft_trans_set(trans));
		break;
	case NFT_MSG_NEWSETELEM:
		nft_set_elem_destroy(nft_trans_elem_set(trans),
@@ -7959,7 +7959,7 @@ static void __nft_release_table(struct net *net, struct nft_table *table)
	list_for_each_entry_safe(set, ns, &table->sets, list) {
		list_del(&set->list);
		nft_use_dec(&table->use);
		nft_set_destroy(set);
		nft_set_destroy(&ctx, set);
	}
	list_for_each_entry_safe(obj, ne, &table->objects, list) {
		nft_obj_del(obj);