handle route updates correctly

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-09-11 11:45:46 -05:00 committed by Kristoffer Dalby
parent c957f893bd
commit 096ac31bb3
3 changed files with 29 additions and 8 deletions

View file

@ -278,6 +278,12 @@ func (hsdb *HSDatabase) saveMachineRoutes(machine *types.Machine) error {
advertisedRoutes[prefix] = false
}
log.Trace().
Str("machine", machine.Hostname).
Interface("advertisedRoutes", advertisedRoutes).
Interface("currentRoutes", currentRoutes).
Msg("updating routes")
for pos, route := range currentRoutes {
if _, ok := advertisedRoutes[netip.Prefix(route.Prefix)]; ok {
if !route.Advertised {