* [nf PATCH] netfilter: nft_limit: Clone packet limits' cost value
@ 2022-05-24 12:50 Phil Sutter
2022-05-26 20:48 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2022-05-24 12:50 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
When cloning a packet-based limit expression, copy the cost value as
well. Otherwise the new limit is not functional anymore.
Fixes: 3b9e2ea6c11bf ("netfilter: nft_limit: move stateful fields out of expression data")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
net/netfilter/nft_limit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nft_limit.c b/net/netfilter/nft_limit.c
index 04ea8b9bf2028..981addb2d0515 100644
--- a/net/netfilter/nft_limit.c
+++ b/net/netfilter/nft_limit.c
@@ -213,6 +213,8 @@ static int nft_limit_pkts_clone(struct nft_expr *dst, const struct nft_expr *src
struct nft_limit_priv_pkts *priv_dst = nft_expr_priv(dst);
struct nft_limit_priv_pkts *priv_src = nft_expr_priv(src);
+ priv_dst->cost = priv_src->cost;
+
return nft_limit_clone(&priv_dst->limit, &priv_src->limit);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nf PATCH] netfilter: nft_limit: Clone packet limits' cost value
2022-05-24 12:50 [nf PATCH] netfilter: nft_limit: Clone packet limits' cost value Phil Sutter
@ 2022-05-26 20:48 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2022-05-26 20:48 UTC (permalink / raw)
To: Phil Sutter; +Cc: netfilter-devel
On Tue, May 24, 2022 at 02:50:01PM +0200, Phil Sutter wrote:
> When cloning a packet-based limit expression, copy the cost value as
> well. Otherwise the new limit is not functional anymore.
Applied, thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-26 20:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-24 12:50 [nf PATCH] netfilter: nft_limit: Clone packet limits' cost value Phil Sutter
2022-05-26 20:48 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).