Fix relay (#827)

Co-authored-by: Nate Brown <nbrown.us@gmail.com>
This commit is contained in:
brad-defined
2023-03-30 12:09:20 -04:00
committed by GitHub
parent e28336c5db
commit 2801fb2286
12 changed files with 282 additions and 109 deletions

View File

@@ -247,7 +247,7 @@ func (n *connectionManager) HandleDeletionTick(now time.Time) {
break
}
hostinfo, err := n.hostMap.QueryIndex(localIndex)
hostinfo, mainHostInfo, err := n.hostMap.QueryIndexIsPrimary(localIndex)
if err != nil {
n.l.WithField("localIndex", localIndex).Debugf("Not found in hostmap")
n.ClearLocalIndex(localIndex)
@@ -269,6 +269,12 @@ func (n *connectionManager) HandleDeletionTick(now time.Time) {
n.ClearLocalIndex(localIndex)
n.ClearPendingDeletion(localIndex)
if !mainHostInfo {
// This hostinfo is still being used despite not being the primary hostinfo for this vpn ip
// Keep tracking so that we can tear it down when it goes away
n.Out(localIndex)
}
continue
}