netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] netfilter: nf_conncount: fix wrong variable type
@ 2024-05-29  1:40 Yunjian Wang
  2024-05-29 12:02 ` Florian Westphal
  0 siblings, 1 reply; 6+ messages in thread
From: Yunjian Wang @ 2024-05-29  1:40 UTC (permalink / raw)
  To: netfilter-devel
  Cc: pablo, kadlec, kuba, davem, coreteam, xudingke, Yunjian Wang

'keylen' is supposed to be unsigned int, not u8, so fix it.

Fixes: 2ba39118c10a ("netfilter: nf_conncount: Move locking into count_tree()")
Fixes: c80f10bc973a ("netfilter: nf_conncount: speculative garbage collection on empty lists")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 net/netfilter/nf_conncount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c
index 8715617b02fe..4554f4b093fa 100644
--- a/net/netfilter/nf_conncount.c
+++ b/net/netfilter/nf_conncount.c
@@ -321,7 +321,7 @@ insert_tree(struct net *net,
 	struct nf_conncount_rb *rbconn;
 	struct nf_conncount_tuple *conn;
 	unsigned int count = 0, gc_count = 0;
-	u8 keylen = data->keylen;
+	unsigned int keylen = data->keylen;
 	bool do_gc = true;
 
 	spin_lock_bh(&nf_conncount_locks[hash]);
@@ -403,7 +403,7 @@ count_tree(struct net *net,
 	struct rb_node *parent;
 	struct nf_conncount_rb *rbconn;
 	unsigned int hash;
-	u8 keylen = data->keylen;
+	unsigned int keylen = data->keylen;
 
 	hash = jhash2(key, data->keylen, conncount_rnd) % CONNCOUNT_SLOTS;
 	root = &data->root[hash];
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-30 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29  1:40 [PATCH net] netfilter: nf_conncount: fix wrong variable type Yunjian Wang
2024-05-29 12:02 ` Florian Westphal
2024-05-30  3:02   ` wangyunjian
2024-05-30  7:52     ` Florian Westphal
2024-05-30  9:42       ` wangyunjian
2024-05-30 13:13         ` Florian Westphal

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).