netfilter: nft_limit: Clone packet limits' cost value
Subsystems (2)
Phil Sutter
reviewerPATCH 1/1 netfilter: nft_limit: Clone packet limits' cost value
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 <[email protected]>
--- net/netfilter/nft_limit.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nft_limit.c +2 -0
@@ -213,6 +213,8 @@ static int nft_limit_pkts_clone(struct nft_expr *dst, const struct nft_expr *srcstruct 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); }
Signature · 1 line
2.34.1
Quoted 2 lines · Phil Sutter
When cloning a packet-based limit expression, copy the cost value as well. Otherwise the new limit is not functional anymore.
Applied, thanks