device: defer state machine transitions until configuration is complete
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
63abb5537b
commit
e3134bf665
3 changed files with 18 additions and 15 deletions
|
|
@ -172,6 +172,11 @@ func (device *Device) upLocked() error {
|
|||
return err
|
||||
}
|
||||
|
||||
// The IPC set operation waits for peers to be created before calling Start() on them,
|
||||
// so if there's a concurrent IPC set request happening, we should wait for it to complete.
|
||||
device.ipcMutex.Lock()
|
||||
defer device.ipcMutex.Unlock()
|
||||
|
||||
device.peers.RLock()
|
||||
for _, peer := range device.peers.keyMap {
|
||||
peer.Start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue