[client] Enable userspace forwarder conditionally (#3309)

* Enable userspace forwarder conditionally

* Move disable/enable logic
This commit is contained in:
Viktor Liu
2025-02-12 11:10:49 +01:00
committed by GitHub
parent 18f84f0df5
commit b41de7fcd1
7 changed files with 145 additions and 54 deletions

View File

@ -286,15 +286,15 @@ func (m *DefaultManager) UpdateRoutes(updateSerial uint64, newRoutes []*route.Ro
m.updateClientNetworks(updateSerial, filteredClientRoutes)
m.notifier.OnNewRoutes(filteredClientRoutes)
}
m.clientRoutes = newClientRoutesIDMap
if m.serverRouter != nil {
err := m.serverRouter.updateRoutes(newServerRoutesMap)
if err != nil {
return err
}
if m.serverRouter == nil {
return nil
}
m.clientRoutes = newClientRoutesIDMap
if err := m.serverRouter.updateRoutes(newServerRoutesMap); err != nil {
return fmt.Errorf("update routes: %w", err)
}
return nil
}