diff options
author | Florian Westphal <fw@strlen.de> | 2023-06-06 14:08:49 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-06-26 08:05:57 +0200 |
commit | 96b2ef9b16cb302d0b47c5670d30a05963e0e1e3 (patch) | |
tree | 29daea88f37f739fdea7af95c41dcb634f5bb3c2 /net/netfilter | |
parent | 78aa23d0081b2029a5763c4f7d396bf2666c0c87 (diff) | |
download | linux-stable-96b2ef9b16cb302d0b47c5670d30a05963e0e1e3.tar.gz linux-stable-96b2ef9b16cb302d0b47c5670d30a05963e0e1e3.tar.bz2 linux-stable-96b2ef9b16cb302d0b47c5670d30a05963e0e1e3.zip |
netfilter: nf_tables: permit update of set size
Now that set->nelems is always updated permit update of the sets max size.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 0396fd8f4e71..dfd441ff1e3e 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -483,6 +483,7 @@ static int __nft_trans_set_add(const struct nft_ctx *ctx, int msg_type, nft_trans_set_update(trans) = true; nft_trans_set_gc_int(trans) = desc->gc_int; nft_trans_set_timeout(trans) = desc->timeout; + nft_trans_set_size(trans) = desc->size; } nft_trans_commit_list_add_tail(ctx->net, trans); @@ -9428,6 +9429,9 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) WRITE_ONCE(set->timeout, nft_trans_set_timeout(trans)); WRITE_ONCE(set->gc_int, nft_trans_set_gc_int(trans)); + + if (nft_trans_set_size(trans)) + WRITE_ONCE(set->size, nft_trans_set_size(trans)); } else { nft_clear(net, nft_trans_set(trans)); /* This avoids hitting -EBUSY when deleting the table |