Fix failover to disabled route #1706 (#1707)

* fix #1706 - failover should disregard disabled routes during failover

* fixe tests for failover; all current tests assume routes to be enabled

* add testcase for #1706 - failover to disabled route
This commit is contained in:
derelm
2024-02-03 15:30:15 +01:00
committed by GitHub
parent b4210e2c90
commit 4ea12f472a
2 changed files with 62 additions and 0 deletions

View File

@@ -585,6 +585,10 @@ func (hsdb *HSDatabase) failoverRoute(r *types.Route) ([]key.MachinePublic, erro
continue
}
if !route.Enabled {
continue
}
if hsdb.notifier.IsConnected(route.Node.MachineKey) {
newPrimary = &routes[idx]
break