|
@@ -173,14 +173,13 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
|
|
|
peerConfig.AllowedIPs = allowedips // only append allowed IPs if valid connection
|
|
|
}
|
|
|
|
|
|
- peerPort := GetPeerListenPort(peerHost)
|
|
|
var nodePeer wgtypes.PeerConfig
|
|
|
if _, ok := peerIndexMap[peerHost.PublicKey.String()]; !ok {
|
|
|
hostPeerUpdate.Peers = append(hostPeerUpdate.Peers, peerConfig)
|
|
|
peerIndexMap[peerHost.PublicKey.String()] = len(hostPeerUpdate.Peers) - 1
|
|
|
hostPeerUpdate.HostNetworkInfo[peerHost.PublicKey.String()] = models.HostNetworkInfo{
|
|
|
Interfaces: peerHost.Interfaces,
|
|
|
- ListenPort: peerPort,
|
|
|
+ ListenPort: peerHost.ListenPort,
|
|
|
IsStatic: peerHost.IsStatic,
|
|
|
}
|
|
|
nodePeer = peerConfig
|
|
@@ -191,7 +190,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
|
|
|
hostPeerUpdate.Peers[peerIndexMap[peerHost.PublicKey.String()]].Remove = false
|
|
|
hostPeerUpdate.HostNetworkInfo[peerHost.PublicKey.String()] = models.HostNetworkInfo{
|
|
|
Interfaces: peerHost.Interfaces,
|
|
|
- ListenPort: peerPort,
|
|
|
+ ListenPort: peerHost.ListenPort,
|
|
|
IsStatic: peerHost.IsStatic,
|
|
|
}
|
|
|
nodePeer = hostPeerUpdate.Peers[peerIndexMap[peerHost.PublicKey.String()]]
|