mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-06-25 22:41:24 +02:00
81-separate-synchronisation-into-independent-process
- nil dereference when no joins
This commit is contained in:
parent
1f8d229076
commit
5efff2314b
@ -238,6 +238,10 @@ func (m *WgMeshConfigApplyer) getClientConfig(params *GetConfigParams) (*wgtypes
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
routesForMesh = lib.Filter(routesForMesh, func (rns []routeNode) {
|
||||||
|
return len(rns) != 0
|
||||||
|
})
|
||||||
|
|
||||||
routes := lib.Map(routesForMesh, func(rs []routeNode) net.IPNet {
|
routes := lib.Map(routesForMesh, func(rs []routeNode) net.IPNet {
|
||||||
return *rs[0].route.GetDestination()
|
return *rs[0].route.GetDestination()
|
||||||
})
|
})
|
||||||
@ -452,7 +456,7 @@ func (m *WgMeshConfigApplyer) getAllRoutes() (map[string][]routeNode, error) {
|
|||||||
allRoutes := make(map[string][]routeNode)
|
allRoutes := make(map[string][]routeNode)
|
||||||
|
|
||||||
for _, mesh := range m.meshManager.GetMeshes() {
|
for _, mesh := range m.meshManager.GetMeshes() {
|
||||||
routes, err := m.getRoutes(mesh)
|
routes, err := m.getRoutes(mesh)2
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user