summaryrefslogtreecommitdiff
path: root/net/core/secure_seq.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-01-11 18:10:37 -0800
committerDavid S. Miller <davem@davemloft.net>2017-01-12 15:57:10 -0500
commitc1ce1560a1ae1a58505c26bc0e46ce1aee982d54 (patch)
tree920361b81c67c89bad538dd8f030d89ded1578aa /net/core/secure_seq.c
parenta8ac1a55d0859cf8f53db3275ad4a6480868e80c (diff)
secure_seq: fix sparse errors
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> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/secure_seq.c')
-rw-r--r--net/core/secure_seq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c
index 3a9fcec94ace..758f140b6bed 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;