* [PATCH net-next] secure_seq: fix sparse errors
@ 2017-01-12 2:10 Eric Dumazet
2017-01-12 11:42 ` Jason A. Donenfeld
2017-01-12 20:57 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2017-01-12 2:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jason A. Donenfeld
From: Eric Dumazet <edumazet@google.com>
Fixes following warnings :
net/core/secure_seq.c:125:28: warning: incorrect type in argument 1
(different base types)
net/core/secure_seq.c:125:28: expected unsigned int const [unsigned]
[usertype] a
net/core/secure_seq.c:125:28: got restricted __be32 [usertype] saddr
net/core/secure_seq.c:125:35: warning: incorrect type in argument 2
(different base types)
net/core/secure_seq.c:125:35: expected unsigned int const [unsigned]
[usertype] b
net/core/secure_seq.c:125:35: got restricted __be32 [usertype] daddr
net/core/secure_seq.c:125:43: warning: cast from restricted __be16
net/core/secure_seq.c:125:61: warning: restricted __be16 degrades to
integer
Fixes: 7cd23e5300c1 ("secure_seq: use SipHash in place of MD5")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/core/secure_seq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c
index 3a9fcec94ace21238c0d6cd6d9997678e0623ab9..758f140b6bedc51669fed973b39ee317c2bf1570 100644
--- a/net/core/secure_seq.c
+++ b/net/core/secure_seq.c
@@ -122,7 +122,9 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
{
u64 seq;
net_secret_init();
- seq = siphash_3u32(saddr, daddr, (u32)sport << 16 | dport, &net_secret);
+ seq = siphash_3u32((__force u32)saddr, (__force u32)daddr,
+ (__force u32)sport << 16 | (__force u32)dport,
+ &net_secret);
seq += ktime_get_real_ns();
seq &= (1ull << 48) - 1;
return seq;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] secure_seq: fix sparse errors
2017-01-12 2:10 [PATCH net-next] secure_seq: fix sparse errors Eric Dumazet
@ 2017-01-12 11:42 ` Jason A. Donenfeld
2017-01-12 20:57 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Jason A. Donenfeld @ 2017-01-12 11:42 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
Nice catch, thanks.
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] secure_seq: fix sparse errors
2017-01-12 2:10 [PATCH net-next] secure_seq: fix sparse errors Eric Dumazet
2017-01-12 11:42 ` Jason A. Donenfeld
@ 2017-01-12 20:57 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-01-12 20:57 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, Jason
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 11 Jan 2017 18:10:37 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> Fixes following warnings :
>
> net/core/secure_seq.c:125:28: warning: incorrect type in argument 1
> (different base types)
> net/core/secure_seq.c:125:28: expected unsigned int const [unsigned]
> [usertype] a
> net/core/secure_seq.c:125:28: got restricted __be32 [usertype] saddr
> net/core/secure_seq.c:125:35: warning: incorrect type in argument 2
> (different base types)
> net/core/secure_seq.c:125:35: expected unsigned int const [unsigned]
> [usertype] b
> net/core/secure_seq.c:125:35: got restricted __be32 [usertype] daddr
> net/core/secure_seq.c:125:43: warning: cast from restricted __be16
> net/core/secure_seq.c:125:61: warning: restricted __be16 degrades to
> integer
>
>
> Fixes: 7cd23e5300c1 ("secure_seq: use SipHash in place of MD5")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-12 20:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-12 2:10 [PATCH net-next] secure_seq: fix sparse errors Eric Dumazet
2017-01-12 11:42 ` Jason A. Donenfeld
2017-01-12 20:57 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.