aboutsummaryrefslogtreecommitdiffstats
path: root/device/timers.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-24 13:48:03 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-24 13:48:25 +0200
commitf70546bc2e5888de0530dfd0f97d8556a98bba68 (patch)
tree5ce68bb484013aebf24c8d90549e68180884f708 /device/timers.go
parentwintun: revise GetInterface() (diff)
downloadwireguard-go-f70546bc2e5888de0530dfd0f97d8556a98bba68.tar.xz
wireguard-go-f70546bc2e5888de0530dfd0f97d8556a98bba68.zip
device: timers: add jitter on ack failure reinitiation
Diffstat (limited to '')
-rw-r--r--device/timers.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/device/timers.go b/device/timers.go
index 5f28fcc..18ee736 100644
--- a/device/timers.go
+++ b/device/timers.go
@@ -147,7 +147,7 @@ func expiredPersistentKeepalive(peer *Peer) {
/* Should be called after an authenticated data packet is sent. */
func (peer *Peer) timersDataSent() {
if peer.timersActive() && !peer.timers.newHandshake.IsPending() {
- peer.timers.newHandshake.Mod(KeepaliveTimeout + RekeyTimeout)
+ peer.timers.newHandshake.Mod(KeepaliveTimeout + RekeyTimeout + time.Millisecond*time.Duration(rand.Int31n(RekeyTimeoutJitterMaxMs)))
}
}