mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
netfilter: nf_tables: reduce trans->ctx.chain references
These objects are the trans_chain subtype, so use the helper instead of referencing trans->ctx, which will be removed soon. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
13f20bc9ec
commit
551b388640
@ -1262,7 +1262,7 @@ static bool nft_table_pending_update(const struct nft_ctx *ctx)
|
|||||||
((trans->msg_type == NFT_MSG_NEWCHAIN &&
|
((trans->msg_type == NFT_MSG_NEWCHAIN &&
|
||||||
nft_trans_chain_update(trans)) ||
|
nft_trans_chain_update(trans)) ||
|
||||||
(trans->msg_type == NFT_MSG_DELCHAIN &&
|
(trans->msg_type == NFT_MSG_DELCHAIN &&
|
||||||
nft_is_base_chain(trans->ctx.chain))))
|
nft_is_base_chain(nft_trans_chain(trans)))))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2815,13 +2815,11 @@ static struct nft_chain *nft_chain_lookup_byid(const struct net *net,
|
|||||||
struct nft_trans *trans;
|
struct nft_trans *trans;
|
||||||
|
|
||||||
list_for_each_entry(trans, &nft_net->commit_list, list) {
|
list_for_each_entry(trans, &nft_net->commit_list, list) {
|
||||||
struct nft_chain *chain = trans->ctx.chain;
|
|
||||||
|
|
||||||
if (trans->msg_type == NFT_MSG_NEWCHAIN &&
|
if (trans->msg_type == NFT_MSG_NEWCHAIN &&
|
||||||
chain->table == table &&
|
nft_trans_chain(trans)->table == table &&
|
||||||
id == nft_trans_chain_id(trans) &&
|
id == nft_trans_chain_id(trans) &&
|
||||||
nft_active_genmask(chain, genmask))
|
nft_active_genmask(nft_trans_chain(trans), genmask))
|
||||||
return chain;
|
return nft_trans_chain(trans);
|
||||||
}
|
}
|
||||||
return ERR_PTR(-ENOENT);
|
return ERR_PTR(-ENOENT);
|
||||||
}
|
}
|
||||||
@ -10625,9 +10623,9 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nft_use_dec_restore(&table->use);
|
nft_use_dec_restore(&table->use);
|
||||||
nft_chain_del(trans->ctx.chain);
|
nft_chain_del(nft_trans_chain(trans));
|
||||||
nf_tables_unregister_hook(trans->ctx.net, table,
|
nf_tables_unregister_hook(trans->ctx.net, table,
|
||||||
trans->ctx.chain);
|
nft_trans_chain(trans));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NFT_MSG_DELCHAIN:
|
case NFT_MSG_DELCHAIN:
|
||||||
@ -10637,7 +10635,7 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
|
|||||||
&nft_trans_basechain(trans)->hook_list);
|
&nft_trans_basechain(trans)->hook_list);
|
||||||
} else {
|
} else {
|
||||||
nft_use_inc_restore(&table->use);
|
nft_use_inc_restore(&table->use);
|
||||||
nft_clear(trans->ctx.net, trans->ctx.chain);
|
nft_clear(trans->ctx.net, nft_trans_chain(trans));
|
||||||
}
|
}
|
||||||
nft_trans_destroy(trans);
|
nft_trans_destroy(trans);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user