From 7e6f2563c76bdf3df1b20d5e75b748893d599199 Mon Sep 17 00:00:00 2001 From: Tim Beatham Date: Tue, 16 Jan 2024 16:25:32 +0000 Subject: [PATCH] fixed bug for demo --- pkg/mesh/config.go | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkg/mesh/config.go b/pkg/mesh/config.go index 9e60bdf..c9fc703 100644 --- a/pkg/mesh/config.go +++ b/pkg/mesh/config.go @@ -345,23 +345,24 @@ func (m *WgMeshConfigApplyer) getPeerConfig(params *GetConfigParams) (*wgtypes.C 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) { - 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) } + + installedRoutes = append(installedRoutes, m.getRoutesToInstall(cfg, params.mesh, n)...) } }