summaryrefslogtreecommitdiff
path: root/net/netfilter
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2022-05-24 14:50:01 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2022-05-26 22:50:34 +0200
commit558254b0b602b8605d7246a10cfeb584b1fcabfc (patch)
treed2259d892bbaf292aded1dd5cd800f27a5301683 /net/netfilter
parent520778042ccca019f3ffa136dd0ca565c486cedd (diff)
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 <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nft_limit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netfilter/nft_limit.c b/net/netfilter/nft_limit.c
index 04ea8b9bf202..981addb2d051 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);
}