1
0
forked from extern/smegmesh

fixed bug for demo

This commit is contained in:
Tim Beatham 2024-01-16 16:25:32 +00:00
parent c91e6e7f68
commit 7e6f2563c7

View File

@ -345,23 +345,24 @@ func (m *WgMeshConfigApplyer) getPeerConfig(params *GetConfigParams) (*wgtypes.C
peerToClients[pubKey.String()] = append(clients, *n.GetWgHost()) peerToClients[pubKey.String()] = append(clients, *n.GetWgHost())
cfg, err := m.convertMeshNode(convertMeshNodeParams{
node: n,
self: self,
mesh: params.mesh,
device: params.dev,
peerToClients: peerToClients,
routes: params.routes,
})
if err != nil {
return nil, err
}
if NodeEquals(self, peer) { if NodeEquals(self, peer) {
cfg, err := m.convertMeshNode(convertMeshNodeParams{
node: n,
self: self,
mesh: params.mesh,
device: params.dev,
peerToClients: peerToClients,
routes: params.routes,
})
if err != nil {
return nil, err
}
installedRoutes = append(installedRoutes, m.getRoutesToInstall(cfg, params.mesh, n)...)
peerConfigs = append(peerConfigs, *cfg) peerConfigs = append(peerConfigs, *cfg)
} }
installedRoutes = append(installedRoutes, m.getRoutesToInstall(cfg, params.mesh, n)...)
} }
} }