netfilter: nf_conncount: fix wrong variable type
Subsystems (2)
PATCH 1/1 netfilter: nf_conncount: fix wrong variable type
'keylen' is supposed to be unsigned int, not u8, so fix it.
--- net/netfilter/nf_conncount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_conncount.c +2 -2
@@ -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];
Signature · 1 line
2.33.0
Florian Westphal
maintainerQuoted 1 line · Yunjian Wang
'keylen' is supposed to be unsigned int, not u8, so fix it.
Its limited to 5, so u8 works fine.
Quoted 9 lines
-----Original Message-----
From: Florian Westphal [mailto:[email protected]]
Sent: Wednesday, May 29, 2024 8:03 PM
To: wangyunjian <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; xudingke <[email protected]>
Subject: Re: [PATCH net] netfilter:nf_conncount: fix wrong variable type
Quoted 4 lines
Quoted 1 line · Yunjian Wang
'keylen' is supposed to be unsigned int, not u8, so fix it.
Its limited to 5, so u8 works fine.
Currently, it does not affect the functionality. The main issue is that code checks will report a warning: implicit narrowing conversion from type 'unsigned int' to small type 'u8'.
Florian Westphal
maintainerQuoted 9 lines · wangyunjian
Quoted 9 lines
-----Original Message-----
From: Florian Westphal [mailto:[email protected]]
Sent: Wednesday, May 29, 2024 8:03 PM
To: wangyunjian <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; xudingke <[email protected]>
Subject: Re: [PATCH net] netfilter:nf_conncount: fix wrong variable type
Quoted 8 lines
Quoted 4 lines
Quoted 1 line · Yunjian Wang
'keylen' is supposed to be unsigned int, not u8, so fix it.
Its limited to 5, so u8 works fine.
Currently, it does not affect the functionality. The main issue is that code checks will report a warning: implicit narrowing conversion from type 'unsigned int' to small type 'u8'.
Then please quote the exact warning in the commit message and remove the u8 temporary variable in favor of data->keylen.
Quoted 25 lines
-----Original Message-----
From: Florian Westphal [mailto:[email protected]]
Sent: Thursday, May 30, 2024 3:52 PM
To: wangyunjian <[email protected]>
Cc: Florian Westphal <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; xudingke <[email protected]>
Subject: Re: [PATCH net] netfilter:nf_conncount: fix wrong variable typeQuoted 5 lines · wangyunjian
Quoted 5 lines
-----Original Message-----
From: Florian Westphal [mailto:[email protected]]
Sent: Wednesday, May 29, 2024 8:03 PM
To: wangyunjian <[email protected]>
Cc: [email protected]; [email protected];Quoted 1 line
Quoted 1 line
xudingke
Quoted 6 lines
Quoted 6 lines
<[email protected]>
Subject: Re: [PATCH net] netfilter:nf_conncount: fix wrong variable typeQuoted 1 line · Yunjian Wang
'keylen' is supposed to be unsigned int, not u8, so fix it.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Its limited to 5, so u8 works fine.
Currently, it does not affect the functionality. The main issue is that code checks will report a warning: implicit narrowing conversion from type 'unsigned int' to small type 'u8'.
Then please quote the exact warning in the commit message and remove the u8 temporary variable in favor of
data->keylen.
OK, I will update it. This is not a bugfix, only considered for net-next?
Thanks.
Florian Westphal
maintainerQuoted 4 lines · wangyunjian
Quoted 2 lines
Then please quote the exact warning in the commit message and remove the u8 temporary variable in favor of
data->keylen.OK, I will update it. This is not a bugfix, only considered for net-next?
nf-next, yes.