File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed 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