|
|
@@ -123,7 +123,7 @@ static void nft_set_trans_bind(const struct nft_ctx *ctx, struct nft_set *set)
|
|
|
list_for_each_entry_reverse(trans, &net->nft.commit_list, list) {
|
|
|
if (trans->msg_type == NFT_MSG_NEWSET &&
|
|
|
nft_trans_set(trans) == set) {
|
|
|
- nft_trans_set_bound(trans) = true;
|
|
|
+ set->bound = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -6547,8 +6547,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:
|
|
|
- if (!nft_trans_set_bound(trans))
|
|
|
- nft_set_destroy(nft_trans_set(trans));
|
|
|
+ nft_set_destroy(nft_trans_set(trans));
|
|
|
break;
|
|
|
case NFT_MSG_NEWSETELEM:
|
|
|
nft_set_elem_destroy(nft_trans_elem_set(trans),
|
|
|
@@ -6621,8 +6620,11 @@ static int __nf_tables_abort(struct net *net)
|
|
|
break;
|
|
|
case NFT_MSG_NEWSET:
|
|
|
trans->ctx.table->use--;
|
|
|
- if (!nft_trans_set_bound(trans))
|
|
|
- list_del_rcu(&nft_trans_set(trans)->list);
|
|
|
+ if (nft_trans_set(trans)->bound) {
|
|
|
+ nft_trans_destroy(trans);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ list_del_rcu(&nft_trans_set(trans)->list);
|
|
|
break;
|
|
|
case NFT_MSG_DELSET:
|
|
|
trans->ctx.table->use++;
|
|
|
@@ -6630,8 +6632,11 @@ static int __nf_tables_abort(struct net *net)
|
|
|
nft_trans_destroy(trans);
|
|
|
break;
|
|
|
case NFT_MSG_NEWSETELEM:
|
|
|
+ if (nft_trans_elem_set(trans)->bound) {
|
|
|
+ nft_trans_destroy(trans);
|
|
|
+ break;
|
|
|
+ }
|
|
|
te = (struct nft_trans_elem *)trans->data;
|
|
|
-
|
|
|
te->set->ops->remove(net, te->set, &te->elem);
|
|
|
atomic_dec(&te->set->nelems);
|
|
|
break;
|