diff options
| author | Jason A. Donenfeld <[email protected]> | 2022-10-10 02:44:02 +0000 |
|---|---|---|
| committer | Jason A. Donenfeld <[email protected]> | 2022-11-18 01:15:15 +0000 |
| commit | 8032bf1233a74627ce69b803608e650f3f35971c (patch) | |
| tree | 1e15cd719358130192c59b8d5a61a0c3c9fbe82c /drivers/net/wireguard/timers.c | |
| parent | random: add helpers for random numbers with given floor or range (diff) | |
| download | kernel-8032bf1233a74627ce69b803608e650f3f35971c.tar.gz kernel-8032bf1233a74627ce69b803608e650f3f35971c.zip | |
treewide: use get_random_u32_below() instead of deprecated function
This is a simple mechanical transformation done by:
@@
expression E;
@@
- prandom_u32_max
+ get_random_u32_below
(E)
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Darrick J. Wong <[email protected]> # for xfs
Reviewed-by: SeongJae Park <[email protected]> # for damon
Reviewed-by: Jason Gunthorpe <[email protected]> # for infiniband
Reviewed-by: Russell King (Oracle) <[email protected]> # for arm
Acked-by: Ulf Hansson <[email protected]> # for mmc
Signed-off-by: Jason A. Donenfeld <[email protected]>
Diffstat (limited to 'drivers/net/wireguard/timers.c')
| -rw-r--r-- | drivers/net/wireguard/timers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireguard/timers.c b/drivers/net/wireguard/timers.c index d54d32ac9bc4..b5706b6718b1 100644 --- a/drivers/net/wireguard/timers.c +++ b/drivers/net/wireguard/timers.c @@ -147,7 +147,7 @@ void wg_timers_data_sent(struct wg_peer *peer) if (!timer_pending(&peer->timer_new_handshake)) mod_peer_timer(peer, &peer->timer_new_handshake, jiffies + (KEEPALIVE_TIMEOUT + REKEY_TIMEOUT) * HZ + - prandom_u32_max(REKEY_TIMEOUT_JITTER_MAX_JIFFIES)); + get_random_u32_below(REKEY_TIMEOUT_JITTER_MAX_JIFFIES)); } /* Should be called after an authenticated data packet is received. */ @@ -183,7 +183,7 @@ void wg_timers_handshake_initiated(struct wg_peer *peer) { mod_peer_timer(peer, &peer->timer_retransmit_handshake, jiffies + REKEY_TIMEOUT * HZ + - prandom_u32_max(REKEY_TIMEOUT_JITTER_MAX_JIFFIES)); + get_random_u32_below(REKEY_TIMEOUT_JITTER_MAX_JIFFIES)); } /* Should be called after a handshake response message is received and processed |
