mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-04 23:38:18 +07:00
netfilter: nf_tables: pass context to object destroy indirection
The new connlimit object needs this to properly deal with conntrack dependencies. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
45ca4e0cf2
commit
00bfb3205e
@ -1070,7 +1070,8 @@ struct nft_object_ops {
|
|||||||
int (*init)(const struct nft_ctx *ctx,
|
int (*init)(const struct nft_ctx *ctx,
|
||||||
const struct nlattr *const tb[],
|
const struct nlattr *const tb[],
|
||||||
struct nft_object *obj);
|
struct nft_object *obj);
|
||||||
void (*destroy)(struct nft_object *obj);
|
void (*destroy)(const struct nft_ctx *ctx,
|
||||||
|
struct nft_object *obj);
|
||||||
int (*dump)(struct sk_buff *skb,
|
int (*dump)(struct sk_buff *skb,
|
||||||
struct nft_object *obj,
|
struct nft_object *obj,
|
||||||
bool reset);
|
bool reset);
|
||||||
|
@ -4787,7 +4787,7 @@ static int nf_tables_newobj(struct net *net, struct sock *nlsk,
|
|||||||
kfree(obj->name);
|
kfree(obj->name);
|
||||||
err2:
|
err2:
|
||||||
if (obj->ops->destroy)
|
if (obj->ops->destroy)
|
||||||
obj->ops->destroy(obj);
|
obj->ops->destroy(&ctx, obj);
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
err1:
|
err1:
|
||||||
module_put(type->owner);
|
module_put(type->owner);
|
||||||
@ -4997,10 +4997,10 @@ static int nf_tables_getobj(struct net *net, struct sock *nlsk,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nft_obj_destroy(struct nft_object *obj)
|
static void nft_obj_destroy(const struct nft_ctx *ctx, struct nft_object *obj)
|
||||||
{
|
{
|
||||||
if (obj->ops->destroy)
|
if (obj->ops->destroy)
|
||||||
obj->ops->destroy(obj);
|
obj->ops->destroy(ctx, obj);
|
||||||
|
|
||||||
module_put(obj->ops->type->owner);
|
module_put(obj->ops->type->owner);
|
||||||
kfree(obj->name);
|
kfree(obj->name);
|
||||||
@ -6003,7 +6003,7 @@ static void nft_commit_release(struct nft_trans *trans)
|
|||||||
nft_trans_elem(trans).priv);
|
nft_trans_elem(trans).priv);
|
||||||
break;
|
break;
|
||||||
case NFT_MSG_DELOBJ:
|
case NFT_MSG_DELOBJ:
|
||||||
nft_obj_destroy(nft_trans_obj(trans));
|
nft_obj_destroy(&trans->ctx, nft_trans_obj(trans));
|
||||||
break;
|
break;
|
||||||
case NFT_MSG_DELFLOWTABLE:
|
case NFT_MSG_DELFLOWTABLE:
|
||||||
nf_tables_flowtable_destroy(nft_trans_flowtable(trans));
|
nf_tables_flowtable_destroy(nft_trans_flowtable(trans));
|
||||||
@ -6328,7 +6328,7 @@ static void nf_tables_abort_release(struct nft_trans *trans)
|
|||||||
nft_trans_elem(trans).priv, true);
|
nft_trans_elem(trans).priv, true);
|
||||||
break;
|
break;
|
||||||
case NFT_MSG_NEWOBJ:
|
case NFT_MSG_NEWOBJ:
|
||||||
nft_obj_destroy(nft_trans_obj(trans));
|
nft_obj_destroy(&trans->ctx, nft_trans_obj(trans));
|
||||||
break;
|
break;
|
||||||
case NFT_MSG_NEWFLOWTABLE:
|
case NFT_MSG_NEWFLOWTABLE:
|
||||||
nf_tables_flowtable_destroy(nft_trans_flowtable(trans));
|
nf_tables_flowtable_destroy(nft_trans_flowtable(trans));
|
||||||
@ -7022,7 +7022,7 @@ static void __nft_release_tables(struct net *net)
|
|||||||
list_for_each_entry_safe(obj, ne, &table->objects, list) {
|
list_for_each_entry_safe(obj, ne, &table->objects, list) {
|
||||||
list_del(&obj->list);
|
list_del(&obj->list);
|
||||||
table->use--;
|
table->use--;
|
||||||
nft_obj_destroy(obj);
|
nft_obj_destroy(&ctx, obj);
|
||||||
}
|
}
|
||||||
list_for_each_entry_safe(chain, nc, &table->chains, list) {
|
list_for_each_entry_safe(chain, nc, &table->chains, list) {
|
||||||
ctx.chain = chain;
|
ctx.chain = chain;
|
||||||
|
@ -96,7 +96,8 @@ static void nft_counter_do_destroy(struct nft_counter_percpu_priv *priv)
|
|||||||
free_percpu(priv->counter);
|
free_percpu(priv->counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nft_counter_obj_destroy(struct nft_object *obj)
|
static void nft_counter_obj_destroy(const struct nft_ctx *ctx,
|
||||||
|
struct nft_object *obj)
|
||||||
{
|
{
|
||||||
struct nft_counter_percpu_priv *priv = nft_obj_data(obj);
|
struct nft_counter_percpu_priv *priv = nft_obj_data(obj);
|
||||||
|
|
||||||
|
@ -826,7 +826,8 @@ static int nft_ct_helper_obj_init(const struct nft_ctx *ctx,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nft_ct_helper_obj_destroy(struct nft_object *obj)
|
static void nft_ct_helper_obj_destroy(const struct nft_ctx *ctx,
|
||||||
|
struct nft_object *obj)
|
||||||
{
|
{
|
||||||
struct nft_ct_helper_obj *priv = nft_obj_data(obj);
|
struct nft_ct_helper_obj *priv = nft_obj_data(obj);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user