File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -657,12 +657,12 @@ var IsAclPolicyValid = func(acl models.Acl) (err error) {
657
657
658
658
var IsPeerAllowed = func (node , peer models.Node , checkDefaultPolicy bool ) bool {
659
659
var nodeId , peerId string
660
- if node .IsGw && peer .IsRelayed && peer .RelayedBy == node .ID .String () {
661
- return true
662
- }
663
- if peer .IsGw && node .IsRelayed && node .RelayedBy == peer .ID .String () {
664
- return true
665
- }
660
+ // if node.IsGw && peer.IsRelayed && peer.RelayedBy == node.ID.String() {
661
+ // return true
662
+ // }
663
+ // if peer.IsGw && node.IsRelayed && node.RelayedBy == peer.ID.String() {
664
+ // return true
665
+ // }
666
666
if node .IsStatic {
667
667
nodeId = node .StaticNode .ClientID
668
668
node = node .StaticNode .ConvertToStaticNode ()
Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ func HandleHostCheckin(h, currentHost *models.Host) bool {
281
281
(h .ListenPort != 0 && h .ListenPort != currentHost .ListenPort ) ||
282
282
(h .WgPublicListenPort != 0 && h .WgPublicListenPort != currentHost .WgPublicListenPort ) || (! h .EndpointIPv6 .Equal (currentHost .EndpointIPv6 ))
283
283
if ifaceDelta { // only save if something changes
284
- if ! h .EndpointIP .Equal (currentHost .EndpointIP ) || ! h .EndpointIPv6 .Equal (currentHost .EndpointIPv6 ) {
284
+ if ! h .EndpointIP .Equal (currentHost .EndpointIP ) || ! h .EndpointIPv6 .Equal (currentHost .EndpointIPv6 ) || currentHost . Location == "" {
285
285
if h .EndpointIP != nil {
286
286
h .Location = logic .GetHostLocInfo (h .EndpointIP .String (), os .Getenv ("IP_INFO_TOKEN" ))
287
287
} else if h .EndpointIPv6 != nil {
@@ -293,6 +293,9 @@ func HandleHostCheckin(h, currentHost *models.Host) bool {
293
293
currentHost .Interfaces = h .Interfaces
294
294
currentHost .DefaultInterface = h .DefaultInterface
295
295
currentHost .NatType = h .NatType
296
+ if h .Location != "" {
297
+ currentHost .Location = h .Location
298
+ }
296
299
if h .ListenPort != 0 {
297
300
currentHost .ListenPort = h .ListenPort
298
301
}
You can’t perform that action at this time.
0 commit comments