mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-08 18:35:20 +02:00
netfilter: nf_tables: A better name for nft_obj_filter
[ Upstream commitecf49cad80
] Name it for what it is supposed to become, a real nft_obj_dump_ctx. No functional change intended. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Stable-dep-of:bd662c4218
("netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ba9b99d909
commit
2c6a79b94e
|
@ -7717,7 +7717,7 @@ static void audit_log_obj_reset(const struct nft_table *table,
|
||||||
kfree(buf);
|
kfree(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct nft_obj_filter {
|
struct nft_obj_dump_ctx {
|
||||||
char *table;
|
char *table;
|
||||||
u32 type;
|
u32 type;
|
||||||
};
|
};
|
||||||
|
@ -7727,7 +7727,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
|
||||||
const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
|
const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
|
||||||
const struct nft_table *table;
|
const struct nft_table *table;
|
||||||
unsigned int idx = 0, s_idx = cb->args[0];
|
unsigned int idx = 0, s_idx = cb->args[0];
|
||||||
struct nft_obj_filter *filter = cb->data;
|
struct nft_obj_dump_ctx *ctx = cb->data;
|
||||||
struct net *net = sock_net(skb->sk);
|
struct net *net = sock_net(skb->sk);
|
||||||
int family = nfmsg->nfgen_family;
|
int family = nfmsg->nfgen_family;
|
||||||
struct nftables_pernet *nft_net;
|
struct nftables_pernet *nft_net;
|
||||||
|
@ -7753,10 +7753,10 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
|
||||||
goto cont;
|
goto cont;
|
||||||
if (idx < s_idx)
|
if (idx < s_idx)
|
||||||
goto cont;
|
goto cont;
|
||||||
if (filter->table && strcmp(filter->table, table->name))
|
if (ctx->table && strcmp(ctx->table, table->name))
|
||||||
goto cont;
|
goto cont;
|
||||||
if (filter->type != NFT_OBJECT_UNSPEC &&
|
if (ctx->type != NFT_OBJECT_UNSPEC &&
|
||||||
obj->ops->type->type != filter->type)
|
obj->ops->type->type != ctx->type)
|
||||||
goto cont;
|
goto cont;
|
||||||
|
|
||||||
rc = nf_tables_fill_obj_info(skb, net,
|
rc = nf_tables_fill_obj_info(skb, net,
|
||||||
|
@ -7788,33 +7788,33 @@ cont:
|
||||||
static int nf_tables_dump_obj_start(struct netlink_callback *cb)
|
static int nf_tables_dump_obj_start(struct netlink_callback *cb)
|
||||||
{
|
{
|
||||||
const struct nlattr * const *nla = cb->data;
|
const struct nlattr * const *nla = cb->data;
|
||||||
struct nft_obj_filter *filter = NULL;
|
struct nft_obj_dump_ctx *ctx = NULL;
|
||||||
|
|
||||||
filter = kzalloc(sizeof(*filter), GFP_ATOMIC);
|
ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC);
|
||||||
if (!filter)
|
if (!ctx)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (nla[NFTA_OBJ_TABLE]) {
|
if (nla[NFTA_OBJ_TABLE]) {
|
||||||
filter->table = nla_strdup(nla[NFTA_OBJ_TABLE], GFP_ATOMIC);
|
ctx->table = nla_strdup(nla[NFTA_OBJ_TABLE], GFP_ATOMIC);
|
||||||
if (!filter->table) {
|
if (!ctx->table) {
|
||||||
kfree(filter);
|
kfree(ctx);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nla[NFTA_OBJ_TYPE])
|
if (nla[NFTA_OBJ_TYPE])
|
||||||
filter->type = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE]));
|
ctx->type = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE]));
|
||||||
|
|
||||||
cb->data = filter;
|
cb->data = ctx;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nf_tables_dump_obj_done(struct netlink_callback *cb)
|
static int nf_tables_dump_obj_done(struct netlink_callback *cb)
|
||||||
{
|
{
|
||||||
struct nft_obj_filter *filter = cb->data;
|
struct nft_obj_dump_ctx *ctx = cb->data;
|
||||||
|
|
||||||
kfree(filter->table);
|
kfree(ctx->table);
|
||||||
kfree(filter);
|
kfree(ctx);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user