mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 17:26:52 +01:00
Hold a pending hybrid responder locked until it is filled in
This commit is contained in:
1 parent
4ce04760ae
commit
70e7d3f2ea
1 file changed
+4
@@ -802,6 +802,10 @@ func (hm *HandshakeManager) beginHandshake(via ViaSender, packet []byte, h *head
|
||||
startTime: time.Now(),
|
||||
responder: &hybridResponder{},
|
||||
}
|
||||
// The index is visible to msg3 as soon as it is allocated, so hold the
|
||||
// entry until it is filled in.
|
||||
pending.Lock()
|
||||
defer pending.Unlock()
|
||||
allocIndex = func() (uint32, error) { return hm.allocateIndex(pending) }
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user