Add check for special android ip in online status check

This commit is contained in:
Vladimir Stoilov
2023-04-14 11:09:20 +02:00
parent 394dbf4d4b
commit 4784799541
4 changed files with 37 additions and 12 deletions

View File

@@ -16,6 +16,7 @@ import (
"github.com/safing/portbase/utils/debug"
_ "github.com/safing/portmaster/core/base"
"github.com/safing/portmaster/intel"
"github.com/safing/portmaster/netenv"
)
var module *modules.Module
@@ -25,6 +26,9 @@ func init() {
}
func prep() error {
// Set DNS test connectivity function for the online status check
netenv.DNSTestQueryFunc = testConnectivity
intel.SetReverseResolver(ResolveIPAndValidate)
if err := registerAPI(); err != nil {

View File

@@ -523,10 +523,6 @@ func shouldResetCache(q *Query) (reset bool) {
return false
}
func init() {
netenv.DNSTestQueryFunc = testConnectivity
}
// testConnectivity test if resolving a query succeeds and returns whether the
// query itself succeeded, separate from interpreting the result.
func testConnectivity(ctx context.Context, fdqn string) (ips []net.IP, ok bool, err error) {
@@ -556,10 +552,10 @@ func testConnectivity(ctx context.Context, fdqn string) (ips []net.IP, ok bool,
}
case errors.Is(err, ErrNotFound):
return nil, true, err
case errors.Is(err, ErrBlocked):
return nil, true, err
case errors.Is(err, ErrNoCompliance):
return nil, true, err
case errors.Is(err, ErrBlocked):
return nil, true, err
default:
return nil, false, err
}