diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-31 06:12:57 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-31 06:12:57 +0200 |
commit | 0c942d003c4291fe05d0de296ac040c7b0d0503c (patch) | |
tree | 0b0b7275c400a3827241d9351dd6de17b7e1e5a5 /src/timers.c | |
parent | main: add missing chacha20poly1305 header (diff) | |
download | wireguard-linux-compat-0c942d003c4291fe05d0de296ac040c7b0d0503c.tar.xz wireguard-linux-compat-0c942d003c4291fe05d0de296ac040c7b0d0503c.zip |
ratelimiter: prevent init/uninit race
Fixes a classic ABA problem that isn't actually reachable because of
rtnl_lock, but it's good to be correct anyway.
Reported-by: Jann Horn <jann@thejh.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.c')
-rw-r--r-- | src/timers.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/timers.c b/src/timers.c index d351fde..f1549a7 100644 --- a/src/timers.c +++ b/src/timers.c @@ -9,6 +9,8 @@ #include "queueing.h" #include "socket.h" +#include <linux/ktime.h> + /* * Timer for retransmitting the handshake if we don't hear back after `REKEY_TIMEOUT + jitter` ms * Timer for sending empty packet if we have received a packet but after have not sent one for `KEEPALIVE_TIMEOUT` ms |