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

@@ -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
}