mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-09 00:13:57 +01:00
Try rehandshaking a main hostinfo after releasing hostmap locks (#863)
This commit is contained in:
parent
31ed9269d7
commit
d1f786419c
@ -22,6 +22,7 @@ const (
|
|||||||
closeTunnel trafficDecision = 2 // delete the hostinfo and notify the remote
|
closeTunnel trafficDecision = 2 // delete the hostinfo and notify the remote
|
||||||
swapPrimary trafficDecision = 3
|
swapPrimary trafficDecision = 3
|
||||||
migrateRelays trafficDecision = 4
|
migrateRelays trafficDecision = 4
|
||||||
|
tryRehandshake trafficDecision = 5
|
||||||
)
|
)
|
||||||
|
|
||||||
type connectionManager struct {
|
type connectionManager struct {
|
||||||
@ -193,6 +194,9 @@ func (n *connectionManager) doTrafficCheck(localIndex uint32, p, nb, out []byte,
|
|||||||
|
|
||||||
case migrateRelays:
|
case migrateRelays:
|
||||||
n.migrateRelayUsed(hostinfo, primary)
|
n.migrateRelayUsed(hostinfo, primary)
|
||||||
|
|
||||||
|
case tryRehandshake:
|
||||||
|
n.tryRehandshake(hostinfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
n.resetRelayTrafficCheck(hostinfo)
|
n.resetRelayTrafficCheck(hostinfo)
|
||||||
@ -321,7 +325,8 @@ func (n *connectionManager) makeTrafficDecision(localIndex uint32, p, nb, out []
|
|||||||
delete(n.pendingDeletion, hostinfo.localIndexId)
|
delete(n.pendingDeletion, hostinfo.localIndexId)
|
||||||
|
|
||||||
if mainHostInfo {
|
if mainHostInfo {
|
||||||
n.tryRehandshake(hostinfo)
|
decision = tryRehandshake
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if n.shouldSwapPrimary(hostinfo, primary) {
|
if n.shouldSwapPrimary(hostinfo, primary) {
|
||||||
decision = swapPrimary
|
decision = swapPrimary
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user