@@ -91,6 +91,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
9191 if err != nil {
9292 continue
9393 }
94+
9495 if ! node .Connected || node .PendingDelete || node .Action == models .NODE_DELETE {
9596 continue
9697 }
@@ -260,6 +261,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
260261 peerAllowedIPs = append (peerAllowedIPs , peerConfig .AllowedIPs ... )
261262 hostPeerUpdate .Peers [peerIndexMap [peerHost .PublicKey .String ()]].AllowedIPs = peerAllowedIPs
262263 hostPeerUpdate .Peers [peerIndexMap [peerHost .PublicKey .String ()]].Remove = false
264+ hostPeerUpdate .Peers [peerIndexMap [peerHost .PublicKey .String ()]].Endpoint = peerConfig .Endpoint
263265 hostPeerUpdate .HostNetworkInfo [peerHost .PublicKey .String ()] = models.HostNetworkInfo {
264266 Interfaces : peerHost .Interfaces ,
265267 ListenPort : peerHost .ListenPort ,
@@ -344,6 +346,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
344346 },
345347 }
346348 }
349+
347350 }
348351 // == post peer calculations ==
349352 // indicate removal if no allowed IPs were calculated
@@ -394,7 +397,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
394397// GetPeerListenPort - given a host, retrieve it's appropriate listening port
395398func GetPeerListenPort (host * models.Host ) int {
396399 peerPort := host .ListenPort
397- if host .WgPublicListenPort != 0 {
400+ if ! host . IsStaticPort && host .WgPublicListenPort != 0 {
398401 peerPort = host .WgPublicListenPort
399402 }
400403 return peerPort
0 commit comments