From e3134bf6659b13bbc4713fe2b9147463cc9ff374 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 11 Nov 2021 03:12:37 +0100 Subject: device: defer state machine transitions until configuration is complete Signed-off-by: Jason A. Donenfeld --- device/peer.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'device/peer.go') diff --git a/device/peer.go b/device/peer.go index c8b825d..5bd52df 100644 --- a/device/peer.go +++ b/device/peer.go @@ -107,15 +107,12 @@ func (device *Device) NewPeer(pk NoisePublicKey) (*Peer, error) { // reset endpoint peer.endpoint = nil + // init timers + peer.timersInit() + // add device.peers.keyMap[pk] = peer - // start peer - peer.timersInit() - if peer.device.isUp() { - peer.Start() - } - return peer, nil } -- cgit v1.2.3