From 4f4501dcb5bb69e7436afbfff126bb1dd17a5cb0 Mon Sep 17 00:00:00 2001 From: merothh Date: Thu, 19 May 2022 15:09:05 +0530 Subject: [PATCH] shouldBlockRequest: Don't block if socket connect fails * On (re)boot: 05-19 13:27:49.303 605 987 I netd : DnsResolverService::setResolverConfiguration(100, [192.168.1.1], [], 1800, 25, 8, 64, 0, 0, [], []) -> (-22) (0.6ms) 05-19 13:27:49.303 605 987 I netd : setResolverConfiguration() -> ServiceSpecificException(22, "Invalid argument") <1.35ms> 05-19 13:27:49.304 1574 1698 E DnsManager: Error setting DNS configuration: android.os.ServiceSpecificException: Invalid argument (code 22) ..which subsequently leads to connectivity check probes failing. * Thanks to Alexandre for the hint --- getaddrinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/getaddrinfo.cpp b/getaddrinfo.cpp index 6caa6e66..7882e11c 100644 --- a/getaddrinfo.cpp +++ b/getaddrinfo.cpp @@ -346,7 +346,7 @@ int shouldBlockRequest(const char* hostname, int uid){ if (connect(sock, (struct sockaddr *)&server, len) < 0) { LOG(DEBUG) << "Socket: connect failed. Error"; close(sock); - return -1; + return 0; } LOG(DEBUG) << "Socket: Connected"; -- GitLab