From: Phil Sutter Date: Tue, 24 May 2022 12:50:01 +0000 (+0200) Subject: netfilter: nft_limit: Clone packet limits' cost value X-Git-Tag: baikal/aarch64/sdk6.1~3836^2~46^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=60975557401d0ab5052ff94d63616175ea161b89;p=kernel.git 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: 062d62c00def9 ("netfilter: nft_limit: move stateful fields out of expression data") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- 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); }