From f70546bc2e5888de0530dfd0f97d8556a98bba68 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 24 May 2019 13:48:03 +0200 Subject: device: timers: add jitter on ack failure reinitiation --- device/timers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'device') 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))) } } -- cgit v1.2.3