Skip to content

Commit 5896e86

Browse files
Phil Sutterummakynes
authored andcommitted
netfilter: nf_tables: Pass const set to nft_get_set_elem
The function is not supposed to alter the set, passing the pointer as const is fine and merely requires to adjust signatures of two called functions as well. Signed-off-by: Phil Sutter <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 56794e5 commit 5896e86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5910,7 +5910,7 @@ static int nft_setelem_parse_flags(const struct nft_set *set,
59105910
return 0;
59115911
}
59125912

5913-
static int nft_setelem_parse_key(struct nft_ctx *ctx, struct nft_set *set,
5913+
static int nft_setelem_parse_key(struct nft_ctx *ctx, const struct nft_set *set,
59145914
struct nft_data *key, struct nlattr *attr)
59155915
{
59165916
struct nft_data_desc desc = {
@@ -5963,7 +5963,7 @@ static void *nft_setelem_catchall_get(const struct net *net,
59635963
return priv;
59645964
}
59655965

5966-
static int nft_setelem_get(struct nft_ctx *ctx, struct nft_set *set,
5966+
static int nft_setelem_get(struct nft_ctx *ctx, const struct nft_set *set,
59675967
struct nft_set_elem *elem, u32 flags)
59685968
{
59695969
void *priv;
@@ -5982,7 +5982,7 @@ static int nft_setelem_get(struct nft_ctx *ctx, struct nft_set *set,
59825982
return 0;
59835983
}
59845984

5985-
static int nft_get_set_elem(struct nft_ctx *ctx, struct nft_set *set,
5985+
static int nft_get_set_elem(struct nft_ctx *ctx, const struct nft_set *set,
59865986
const struct nlattr *attr, bool reset)
59875987
{
59885988
struct nlattr *nla[NFTA_SET_ELEM_MAX + 1];

0 commit comments

Comments
 (0)