mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-11 08:23:58 +01:00
need to hold lock during cacheCb
This commit is contained in:
parent
c7f1bed882
commit
2ff26b261d
@ -376,11 +376,11 @@ func (hm *HandshakeManager) StartHandshake(vpnIp iputil.VpnIp, cacheCb func(*Han
|
||||
hm.Lock()
|
||||
|
||||
if hh, ok := hm.vpnIps[vpnIp]; ok {
|
||||
hm.Unlock()
|
||||
// We are already trying to handshake with this vpn ip
|
||||
if cacheCb != nil {
|
||||
cacheCb(hh)
|
||||
}
|
||||
hm.Unlock()
|
||||
return hh.hostinfo
|
||||
}
|
||||
|
||||
@ -422,9 +422,7 @@ func (hm *HandshakeManager) StartHandshake(vpnIp iputil.VpnIp, cacheCb func(*Han
|
||||
}
|
||||
|
||||
hm.Unlock()
|
||||
if !hm.lightHouse.IsLighthouseIP(vpnIp) {
|
||||
hm.lightHouse.QueryServer(vpnIp)
|
||||
}
|
||||
return hostinfo
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user