1
0
forked from extern/smegmesh
This commit is contained in:
Tim Beatham 2024-01-16 16:59:07 +00:00
parent 7e6f2563c7
commit 3f82ef9cd7

View File

@ -36,7 +36,7 @@ type routeNode struct {
type convertMeshNodeParams struct {
node MeshNode
self MeshNode
correspondingPeer MeshNode
mesh MeshProvider
device *wgtypes.Device
peerToClients map[string][]net.IPNet
@ -71,7 +71,7 @@ func (m *WgMeshConfigApplyer) convertMeshNode(params convertMeshNodeParams) (*wg
}
// Else there is more than one candidate so consistently hash
pickedRoute = lib.ConsistentHash(bestRoutes, params.self, bucketFunc, m.hashFunc)
pickedRoute = lib.ConsistentHash(bestRoutes, params.correspondingPeer, bucketFunc, m.hashFunc)
}
if pickedRoute.gateway == pubKey.String() {
@ -347,7 +347,7 @@ func (m *WgMeshConfigApplyer) getPeerConfig(params *GetConfigParams) (*wgtypes.C
cfg, err := m.convertMeshNode(convertMeshNodeParams{
node: n,
self: self,
correspondingPeer: peer,
mesh: params.mesh,
device: params.dev,
peerToClients: peerToClients,
@ -373,7 +373,7 @@ func (m *WgMeshConfigApplyer) getPeerConfig(params *GetConfigParams) (*wgtypes.C
peer, err := m.convertMeshNode(convertMeshNodeParams{
node: n,
self: self,
correspondingPeer: self,
mesh: params.mesh,
peerToClients: peerToClients,
routes: params.routes,