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,7 +345,6 @@ func (m *WgMeshConfigApplyer) getPeerConfig(params *GetConfigParams) (*wgtypes.C
peerToClients[pubKey.String()] = append(clients, *n.GetWgHost()) peerToClients[pubKey.String()] = append(clients, *n.GetWgHost())
if NodeEquals(self, peer) {
cfg, err := m.convertMeshNode(convertMeshNodeParams{ cfg, err := m.convertMeshNode(convertMeshNodeParams{
node: n, node: n,
self: self, self: self,
@ -359,9 +358,11 @@ func (m *WgMeshConfigApplyer) getPeerConfig(params *GetConfigParams) (*wgtypes.C
return nil, err return nil, err
} }
installedRoutes = append(installedRoutes, m.getRoutesToInstall(cfg, params.mesh, n)...) if NodeEquals(self, peer) {
peerConfigs = append(peerConfigs, *cfg) peerConfigs = append(peerConfigs, *cfg)
} }
installedRoutes = append(installedRoutes, m.getRoutesToInstall(cfg, params.mesh, n)...)
} }
} }