Add check for special android ip in online status check
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user