mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Fix geolocation lookup errors during device location estimation
This commit is contained in:
parent
c5c54d16e1
commit
caa43f4167
1 changed files with 5 additions and 0 deletions
|
@ -205,6 +205,7 @@ func SetInternetLocation(ip net.IP, source DeviceLocationSource) (dl *DeviceLoca
|
||||||
geoLoc, err := geoip.GetLocation(ip)
|
geoLoc, err := geoip.GetLocation(ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("netenv: failed to get geolocation data of %s (from %s): %s", ip, source, err)
|
log.Warningf("netenv: failed to get geolocation data of %s (from %s): %s", ip, source, err)
|
||||||
|
return nil, false
|
||||||
} else {
|
} else {
|
||||||
loc.Location = geoLoc
|
loc.Location = geoLoc
|
||||||
}
|
}
|
||||||
|
@ -214,6 +215,10 @@ func SetInternetLocation(ip net.IP, source DeviceLocationSource) (dl *DeviceLoca
|
||||||
}
|
}
|
||||||
|
|
||||||
func addLocation(dl *DeviceLocation) {
|
func addLocation(dl *DeviceLocation) {
|
||||||
|
if dl == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
locationsLock.Lock()
|
locationsLock.Lock()
|
||||||
defer locationsLock.Unlock()
|
defer locationsLock.Unlock()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue