aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/timers.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-07-26 01:04:31 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-08-02 02:55:42 +0200
commit89b354799a6f904a133e684f875574e839c57f5e (patch)
treef353503dceeaa872c3952c99cbba4ac4600c99ee /src/timers.c
parentratelimiter: correct comment (diff)
downloadwireguard-monolithic-historical-89b354799a6f904a133e684f875574e839c57f5e.tar.xz
wireguard-monolithic-historical-89b354799a6f904a133e684f875574e839c57f5e.zip
timers: use more clear pow macro
Diffstat (limited to 'src/timers.c')
-rw-r--r--src/timers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timers.c b/src/timers.c
index 636b851..ab9ada4 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -21,7 +21,7 @@ enum {
/* This rounds the time down to the closest power of two of the closest quarter second. */
static inline unsigned long slack_time(unsigned long time)
{
- return time & ~(BIT_MASK(ilog2(HZ / 4) + 1) - 1);
+ return time & ~(roundup_pow_of_two(HZ / 4) - 1);
}
static void expired_retransmit_handshake(unsigned long ptr)