From: Yunjian Wang <wangyunjian@huawei.com>
To: <netfilter-devel@vger.kernel.org>
Cc: <pablo@netfilter.org>, <kadlec@netfilter.org>, <kuba@kernel.org>,
<davem@davemloft.net>, <coreteam@netfilter.org>,
<xudingke@huawei.com>, Yunjian Wang <wangyunjian@huawei.com>
Subject: [PATCH net] netfilter: nf_conncount: fix wrong variable type
Date: Wed, 29 May 2024 09:40:29 +0800 [thread overview]
Message-ID: <1716946829-77508-1-git-send-email-wangyunjian@huawei.com> (raw)
'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
next reply other threads:[~2024-05-29 1:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 1:40 Yunjian Wang [this message]
2024-05-29 12:02 ` [PATCH net] netfilter: nf_conncount: fix wrong variable type 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1716946829-77508-1-git-send-email-wangyunjian@huawei.com \
--to=wangyunjian@huawei.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=xudingke@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).