aboutsummaryrefslogtreecommitdiff
path: root/ResolverController.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace android::sp by std::shared_ptr and drop the libutils dependencyKen Chen2023-12-141-1/+1
| | | | | | Bug: 298596613 Test: m; flash; atest Change-Id: I65635a7d985869fb02953ca00357fedac99c0133
* Take metered information from setResolverConfiguration am: 69390aa5cfKen Chen2023-11-011-1/+2
|\ | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/DnsResolver/+/2799635 Change-Id: Ic94b4031a4745f47a957957344d1bf0a5772d1bb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * Take metered information from setResolverConfigurationKen Chen2023-11-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | 1. Uses dnsresolver_aidl_interface_lateststable_version 12. 2. Get the 'metered' parameter from setResolverConfiguration and keep it in NetConfig of each network. 3. Add resolv_is_metered_network() for DnsProxyListener. Bug: 288340533 Test: atest resolv_integration_test resolv_unit_test Change-Id: I390199b93a9f5b3c0abc8f072d91153ef9fac32e
* | [Code Health] Move 'using' out of functions am: 592e8227b2 am: eaa76e6252Ken Chen2023-09-111-5/+2
|\| | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/DnsResolver/+/2746594 Change-Id: I5a99567cb8fcd373bf1a67f85105fdf6510a86fd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * [Code Health] Move 'using' out of functionsKen Chen2023-09-111-5/+2
| | | | | | | | | | | | Refactor only. No functionality change. Change-Id: I242af40d421b7b8da89253d6781d55b3f4784d85
* | [Code Health] Delete unused code. am: aa510cee9a am: ebbb941116Ken Chen2023-09-111-2/+0
|\| | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/DnsResolver/+/2746873 Change-Id: Ic900d8164c524d7c275945cecdc31cc4a672ccfa Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * [Code Health] Delete unused code.Ken Chen2023-09-081-2/+0
| | | | | | | | Change-Id: Ia8db6f9c186f72b47e661d2dda779143e4e67cfc
* | Fix use-after-free in DNS64 discovery threadKen Chen2023-08-091-7/+7
|/ | | | | | | | | | | | | | | | | DNS64 discovery thread is detached from binder requesting thread. But the discovery thread references resources not belongs to itself, which can be destroyed in dnsresolver destruction. Holds a strong pointer of Dns64Configuration in DNS64 discovery thread so that the instance of Dns64Configuration will keep until the DNS64 thread is force terminated. Ignore-AOSP-First: Fix security vulnerability Bug: 278303745 Test: atest Merged-In: Id74ea4e6f54a00805d3cc8a9d7e15e58a473b7d3 Change-Id: Id74ea4e6f54a00805d3cc8a9d7e15e58a473b7d3 (cherry picked from commit 254115584ff558fb87ee6ec5f5bb043f76219910)
* Change the type of wait_for_pending_req_timeout_count from vector to intMike Yu2022-10-131-10/+7
| | | | | | | | No functionality change in this CL. Bug: 242491440 Test: atest Change-Id: I53a473d86ad5b14a12df8b1a58d61e41ad137907
* Send metrics NetworkDnsServerSupportReported to statsdMike Yu2022-08-291-2/+12
| | | | | | | | | | | | | | | The metrics are used to show the validation status of each private DNS, which can tell us a rough success validation rate and we might make more improvements based off that. The metrics are per-network and are filled when destroyNetworkCache() is called. To avoid adding the dependency stats_proto in resolv_integration_test, there are also some code changes in resolv_private_dns_test.cpp Bug: 241788170 Test: atest Test: m statsd_testdrive; run "statsd_testdrive 504" Change-Id: I5d79d6280e937ee298485cd85ae71e692fd7a0b8
* Change setDoh and clearDoh to private methodMike Yu2022-07-251-15/+0
| | | | | | | | | | | Now setDoh() is called in PrivateDnsConfiguration::set() and clearDoh() is called in PrivateDnsConfiguration::clear(). Also add setDot() and clearDot(). Bug: 239659682 Test: atest Change-Id: I10bbba46474e1e45fffbb96460c14c9814924711
* Refactor DnsResponderClient::GetResolverInfoMike Yu2022-07-181-1/+2
| | | | | | | | | | | | Refactor GetResolverInfo() to return a wrapper, so callers won't have to define several variables to pass them to the function. Apart from that, this change fixes a bug that the DnsResolver crashes if wait_for_pending_req_timeout_count is an empty vector. Bug: 237766689 Test: atest Change-Id: I4ce05be760eca7f52e36c9b0b79852a054bfc757
* Exclude VPN and mobile data from .local resolutionKen Chen2022-03-041-4/+6
| | | | | | | | | There is no point in sending multicast DNS over VPN or mobile data. Bug: 209492138 Test: atest Test: adb root; adb shell dumpsys dnsresolver Change-Id: I8987d3c9f219c42247e9fd8f85880a1d49fcedad
* Remove redundant "using" statementsYi Kong2022-02-181-2/+0
| | | | | | | | They are already under the same namespace. Test: presubmit Bug: 219872355 Change-Id: Ibbd5dc4bed7779eee99f553f8dc3e7a8f0bec4bd
* Update language to comply with Android's inclusive language guidanceNucca Chen2022-01-111-1/+1
| | | | | | | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference Lint robot prefer to use inclusive terms for 'sane' as: https://android-review.googlesource.com/c/platform/system/netd/+/1944696 Replace 'sane' by 'valid'. BUG=162536543 Test: build, only comment changed Change-Id: Ieb3124622e8a315a0df18e526bf2067d1d10bb47
* Skip res_doh_send() if there is no validated DoH serversMike Yu2022-01-041-4/+4
| | | | | | | | | | | | | Since res_doh_send() can take around 2 milliseconds, skip calling it when there is no DoH servers validated. Bug: 212364676 Test: ran "dnschk --attempts 1000 --randomname" w/o this change it takes 36 seconds w/ this change it takes 32 seconds Test: checked the log to ensure that "performing query over Https" is not printed when the DNS doesn't support DoH Change-Id: I1718534889b097eb89ba12a291da0fb19f13bbbd
* Remove default log tagMike Yu2021-10-211-1/+1
| | | | | | | | | Remove the default tag so as not to affect the entire netd process. Also rename the log tag in ResolverController as "resolv". Bug: 203712926 Test: checked the netd and the dnsresolver log. Change-Id: Ia16170381f4c4986883b71c281e1f8f5accd9dd4
* Cleanup DoH statistics when DoH is not supported in the private DNS mode.waynema2021-10-011-13/+4
| | | | | | | | | | | | | | | | | Test steps: a. Default enable strict mode. b. Turn on WiFi and Mobile data. c. Swtich private DNS mode from strict mode to automatic mode. d. Expect to see DoH statistics only on WiFi. e. Switch private DNS mode from automatic mode to off mode. f. Expect to see no DoH statistics showing up on both WiFi and Mobile data. Tests will be done in a follow-up CL. Bug: 201735918 Test: Check output in dumpsys dnsresolver Change-Id: Ie4e67c3967778ada480cb2b5f9222cde5d2c705e
* DoH statistics is now available from DnsStats and is shown in dumpsys ↵waynema2021-09-281-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dnsresolver. Example of output from dumpsys dnsresolver: Server statistics: (total, RTT avg, {rcode:counts}, last update) over UDP 8.8.4.4 (3, 2503ms, [TIMEOUT:3 ], 465s) score{71.0} 8.8.8.8 (4, 1880ms, [NOERROR:1 TIMEOUT:3 ], 468s) score{77.3} 2001:4860:4860::8844 (9, 15ms, [NOERROR:9 ], 78s) score{99.8} 2001:4860:4860::8888 <no data> score{100.0} over DOH 2001:4860:4860::8888 (89, 30ms, [NOERROR:89 ], 127s) score{99.7} over TLS 8.8.4.4 <no data> score{100.0} 8.8.8.8 <no data> score{100.0} 2001:4860:4860::8844 <no data> score{100.0} 2001:4860:4860::8888 <no data> score{100.0} over TCP 8.8.4.4 <no data> score{100.0} 8.8.8.8 <no data> score{100.0} 2001:4860:4860::8844 <no data> score{100.0} 2001:4860:4860::8888 <no data> score{100.0} over MDNS 224.0.0.251 <no data> score{100.0} ff02::fb <no data> score{100.0} TC mode: default TransportType: WIFI Test steps: a. Default enable strict mode. b. Turn on WiFi. c. Turn on Mobile data. d. Check the output from dumpsys dnsresolver. e. Expect to see two different statistics with the same DNS server on different NetId. NetId: 101 over DOH 2001:4860:4860::8888 (90, 29ms, [NOERROR:90 ], 7s) score{99.7} TransportType: WIFI NetId: 102 over DOH 2001:4860:4860::8888 (2, 33ms, [NOERROR:2 ], 74s) score{99.7} TransportType: CELLULAR Bug: 195092631 Test: checked output in dumpsys dnsresolver Change-Id: I65c69a850bce352839314833d44c9f165c7ca142
* Subsampling DNS event for mDNSchenbruce2021-08-251-1/+3
| | | | | | | | | | | | | | | | | | | | Currently, a device generates some mDNS queries when the user uses mDNS .local resolution. Using the query info by subsampling events based on how interesting they are. Because the number of mDNS query is much less than DNS query, the mDNS subsampling rate is higer than DNS query. - if return_code == 0,2,7 -> log 1 in 1 event - if return_code == default -> log 1 in 1 event Also allow to use experiment flag to update sub-sampling denom. Example for dumpsys dnsresolver: NetId: 100 DnsEvent subsampling map for MDNS: default:1 Bug: 197092658 Test: cd packages/modules/DnsResolver && atest m statsd_testdrive and run "statsd_testdrive 116" Change-Id: I76073aa9a1cea43bda2675334592ed22e96a238e
* Remove the confusing log in getPrefix64Mike Yu2021-08-171-2/+0
| | | | | | | | | | | | | | | This log can sometimes confuse people. A common case where this log is printed is that an app specifies AF_UNSPEC but there are no resolved IPv6 addresses for the hostname. ResolverController: No valid NAT64 prefix (106, <unspecified>/0) After this change, the resolver logs will still be enough for us to infer if DNS64 synthesis is performed. Bug: 196888805 Test: build dnsresolver pass Change-Id: Ic06299d1a0c6526e7ed1a0a418a8da19dbf2b6da
* Link Rust DoH into DnsResolver with default offLuke Huang2021-07-141-3/+14
| | | | | | | | Expect no behavior changes since DoH is disabled. Test: atest Bug: 155855709 Change-Id: Ie99cc4c4035c9bfda4a125f5ebf57e2e2f9d2036
* Add Mdns statistics logchenbruce2021-07-021-1/+10
| | | | | | | | | | When developers run "dumpsys dnsresolver", Mdns statistics will show the information in the log if the Mdns queries happened. Bug: 140857615 Test: cd packages/modules/DnsResolver && atest Change-Id: Iec0657d417ddf329590f1fc0a599497aaf45639b
* Revert "Support evaluating private DNS by latency"Mike Yu2021-06-131-7/+2
| | | | | | | | | | | This reverts commit 1aede8135e8a227e127f826f38073eba7447c382. This is no longer needed since we will implement a simpler mechanics for DoT validation. Bug: 188153519 Test: cd packages/modules/DnsResolver && atest Change-Id: I4a2f8b926f27fd38c58aea3a993a311a74fc4950
* Clean up DnsTlsDispatcher when a network is disconnectedMike Yu2021-06-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | DnsTlsDispatcher used to keep Transport in the map for at least 5 minutes. Since Transport is no longer a stateless object, it needs to be removed as soon as the associated network, testing network particularly, is disconnected. This change actually fixes two known test bugs: - bug 189384775. How to reproduce it: run TlsServerRevalidation twice. $ ./resolv_integration_test64 --gtest_filter="*TlsServerRevalidation" $ ./resolv_integration_test64 --gtest_filter="*TlsServerRevalidation" - bug 189132684 How to reproduce it: run ConnectTlsServerTimeout and QueryTlsServerTimeout before before ConnectTlsServerTimeout_ConcurrentQueries. $ ./resolv_integration_test64 --gtest_filter="*ConnectTlsServerTimeout:*QueryTlsServerTimeout" $ ./resolv_integration_test64 --gtest_filter="*ConnectTlsServerTimeout_ConcurrentQueries" Bug: 189384775 Bug: 189132684 Bug: 189161918 Test: run atest on R platform with the dnsresolver built from master Test: run atest on Q platform with the dnsresolver built from mainline-prod Test: verified that the two mentioned bugs are not reproducible Test: run resolv_integration_test twice Change-Id: I3bf3b7ddec7818c4fcf3ffaa0f97173d876d3642
* Support evaluating private DNS by latencyMike Yu2021-06-051-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The evaluation is limited to opportunistic mode and is implemented as a flag-off feature. It is introduced to avoid from using high latency private DNS servers. The latency of a server is considered high if it's higher than a latency threshold which is calculated based on the average latency of cleartext DNS server: latency threshold = std::clamp(3 * mean_do53_latency_ms, min_private_dns_latency_threshold_ms, max_private_dns_latency_threshold_ms) , where min_private_dns_latency_threshold_ms is 500 ms by default and max_private_dns_latency_threshold_ms is 2000 ms by default. If there's no Do53 average latency for reference, the latency threshold is min_private_dns_latency_threshold_ms. The evaluation of a private DNS server works in two phases. Phase 1: In this phase, Private DNS Validation is being performed, and the server is not considered validated. The server latency is evaluated by sending a probe. If the latency is lower than a the latency threshold, the server state is transitioned to Validation::success. The evaluation goes to phase 2. Phase 2: In this phase, the server is considered validated and DnsResolver can send DNS queries to the server. The server latency is evaluated by the query response time, and the same latency threshold is used. If there are several, 10 by default, query response time failed to meet the time threshold in a row, the server state is transitioned to Validation::in_process. The evaluation goes to phase 1. Bug: 188153519 Test: run atest with all the flags off/on avoid_bad_private_dns: 0 / 1 sort_nameservers: 0 / 1 dot_xport_unusable_threshold: -1 / 20 dot_query_timeout_ms: -1 / 10000 min_private_dns_latency_threshold_ms: -1 / 500 keep_listening_udp: 0 / 1 parallel_lookup_sleep_time: 2 / 2 dot_revalidation_threshold: -1 / 10 max_private_dns_latency_threshold_ms: -1 / 2000 dot_async_handshake: 0 / 1 dot_maxtries: 3 / 1 dot_connect_timeout_ms: 127000 / 10000 parallel_lookup_release: UNSET / UNSET Change-Id: Ib681b1ea1417eadac9c013f19549a9fa7c408696
* ResolverController - log NAT64 prefix in standard formatMaciej Żenczykowski2021-02-261-2/+2
| | | | | | | | | | | Switch from: D ResolverController: Sending Nat64Prefix added event on netId 100 with address {64:ff9b::(96)} to: D ResolverController: Sending Nat64Prefix added event on netId 100 with prefix 64:ff9b::/96 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I62945a062cc9039ec9f48cf2daf8ee6455b6a869
* ResolverController - fix NAT64 prefix logging a 'char' instead of an int.Maciej Żenczykowski2021-02-241-2/+2
| | | | | | | | | | | | | | | | | | Currently we have: D ResolverController: Sending Nat64Prefix added event on netId 100 with address {64:ff9b::(`)} This is because: struct Nat64PrefixInfo { unsigned netId; bool added; std::string prefixString; uint8_t prefixLength; }; and thus the uint8_t is simply treated as a char(acter). Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I2a5e1ed7a1d3072c7338b1a1288540682b5514d6
* [DRUEL04] Implement unsolicited NAT64 prefix eventpaulhu2021-01-181-3/+21
| | | | | | | | | | Implement unsolicited NAT64 prefix event that will report to the listener when change NAT64 prefix. Bug: 173485754 Test: atest resolv_integration_test resolv_unit_test\ resolv_stress_test resolv_stats_test_utils_test Change-Id: If20353529969ffa956b56d19345519f286046e25
* Logging private DNS validation stateMike Yu2020-12-221-30/+0
| | | | | | | | | Log the validation state whenever it's changed, and output the result to dumpsys. Bug: 79727473 Test: cd packages/modules/DnsResolver && atest Change-Id: I3afe28f546562228e1a0dfc2a8a55de5b5f08a7e
* Extend DnsTlsServer to return IP stringMike Yu2020-11-271-14/+5
| | | | | | | | No functionality change. Bug: 79727473 Test: cd packages/modules/DnsResolver && atest Change-Id: I7adca3f240197fe59f683abefaa0005af0fbc141
* Remove validation threads tracking in PrivateDnsConfigurationMike Yu2020-11-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The validation threads tracking is not necessary since DnsTlsServer itself can provide sufficient information to PrivateDnsConfiguration to decide if a validation should start. This change comprises: [1] Remove mPrivateDnsValidateThreads and related functions [2] Extend DnsTlsServer to tell if it is a present server for a network. [3] PrivateDnsConfiguration reserves every DnsTlsServer object until being set to OFF mode or the network is destroyed. Make use of [2] to determine which servers should be active for the network. [4] DnsTlsServers with identical IP address but different private DNS provider hostname are treated as different servers, and thus they have their own validation thread. [5] Add a new state, Validation::success_but_expired, which is used to determine if a server which had passed the validation should be revalidated again. [6] To fit in with [4], some related tests are modified. Bug: 79727473 Test: cd packages/modules/DnsResolver && atest Change-Id: I78afce543ea05be39c36d268576824e9ec798b12
* Decouple PrivateDnsConfiguration from resolv_cache.hMike Yu2020-11-181-0/+8
| | | | | | | | | | This change is to simplify writting tests for PrivateDnsConfiguration. Also add a network ID check before starting any resolver configuration. Bug: 79727473 Test: cd packages/modules/DnsResolver && atest Change-Id: Icf0040c67aafe5318a61fc3d2b7158d8f0384367
* Clean up gPrivateDnsConfigurationMike Yu2020-08-031-6/+6
| | | | | | | | | | Use singleton to get an instance of PrivateDnsConfiguration. The lifetime of the instance is almost aligned with the DnsResolver service. Bug: 130686826 Test: cd packages/modules/DnsResolver && atest Change-Id: Id71f90c7d0508eacd1b20db42408a78d9ea1e03a
* Drop the dependency of FwmarkMike Yu2020-05-211-9/+9
| | | | | | | | | The resolver used to generate the desired network mark for DoT sockets. Now, change to get the network mark from netd. Bug: 151895202 Test: Private DNS works as usual (even on VPN) Change-Id: Ibb3e3e1ce0b43cb74962dd4436a47e9b458fa19a
* Rename ResolverExperimentalOptions to ResolverOptionsKen Chen2020-04-071-3/+3
| | | | | | | | Remove 'Experimental' from parcel name and variable name for better naming. Bug: 139646101 Change-Id: Iaa75e8028e98998eca4c9b821aa07effab19dac3
* Merge "Add transport types to a given network"Bruce Chen2020-04-031-5/+4
|\
| * Add transport types to a given networkchenbruce2020-04-011-5/+4
| | | | | | | | | | | | | | | | | | | | - Resolver doesn't know what the transport types are when having a given network. Set tranport types by SetResolverConfiguration. Bug: 143732914 Test: atest Change-Id: I337d4204afd9fbb790fd42cc191759b22dd66bca
* | Change logging level from ERROR to INFO for no DNS64 prefixHungming Chen2020-03-271-1/+1
|/ | | | | | | | Actually, it is not an error because the network environment may not have a NAT64 server. Test: atest Change-Id: Id7ad35914ac9736c9c465dce9f7b21fdffe76fa7
* Support alternative handling on truncated DNS responseKen Chen2020-01-221-1/+3
| | | | | | | | | | | | | | | | | | | The default behavior of UDP truncated DNS response is that the DNS resolver fallback on TCP on the same server. If the fallback retry is failed, do TCP retry on the rest of servers. However, OEM reported that the rest of servers may respond a valid answer on UDP connection, but support no TCP connection. Thus, an alternative truncated response handling mode is added for OEMs. With the alternative mode, the DNS resolver fallback retries on TCP on the same server. If the TCP retry is failed, do UDP retry on the next server, then TCP, and so on. Set mode by ResolverExperimentalOptionsParcel in ResolverParamsParcel. tcMode=0 or absent, run default behavior (TCP-only on each DNS server). tcMode=1, run alternative mode (UDP first on each DNS server). other values are invalid input, take no effect. Bug: 139646101 Change-Id: I724cc54bd9fad95954de84c281dd6f1d0b764caa
* Customized hostname/address table for DNS querychenbruce2020-01-081-1/+1
| | | | | | | | | | | | | | | | | | | - Some Android OEMs would like to create their own customized table (hostname/address mapping lists) that the resolver looks up before querying dns servers and gets the result directly. - About DNS query, resolver checks system/etc/hosts first. If no data is found, resolver will query dns from the server. We add a new parameter to ResolverParamsParcel for OEMs to customize the table and OEMs can use setDnsConfigurationForNetwork to create the hostname/address lists. After OEMs create their own lists,the dns query will be following sequence. system/ect/hosts -> customized table -> dns server - Add test cases: GetAddrInfoFromCustTable, GetAddrInfoFromCustTable_InvalidInput, GetAddrInfoFromCustTable_Modify Bug: 122998288 Test: cd packages/modules/DnsResolver && atest Change-Id: I7a2d689de74f0076f0115e0cb20fdc028903ae86
* Merge "Move private headers out of /include folder"Ken Chen2019-11-211-1/+1
|\
| * Move private headers out of /include folderKen Chen2019-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | 1. The /include folder is exported by export_include_dirs attribute. The headers for internal use should be moved to another place. 2. Remove unnecessary #inlcude from public headers. So we can have a compact .lsdump for ABI checker. Bug: 144407448 Test: atest Change-Id: I5bb0df02a1ccb70f0e91f4b77668ce54e0127f62
* | Add an API to flush cache on designated networkKen Chen2019-11-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | Flush entire cache on a specified network. The API acquires lock before manipulate cache. It's thread-safe API. Bug: 139646101 Test: atest resolv_cache_unit_test.cpp#FlushCache Test: atest resolv_integration_test.cpp#FlushNetworkCache Change-Id: I4ea34a256013468ceac21ce5067d6a493d8631f8
* | Change to use experiment flags to configure private DNS connect timeoutMike Yu2019-11-151-3/+3
|/ | | | | | | | | | | | | | The previous change aosp/1125321 uses dnsresolver binder service to set the timeout value. It can complicate the configuration setup when we provide more than one way to configure the value. The timeout value is expected to be controllable by the flag only. Bug: 120182528 Bug: 141218721 Test: atest --include-subdirs packages/modules/DnsResolver Test: manually set the flag to the device and saw the timeout was changed Change-Id: I9b2b566cff3eb7a98162d32ef3716f5c4379b221
* Modularize resolver statisticsMike Yu2019-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The extendibility of the legacy resolver statistics is limited because it was originally designed for libc, which is hard to implement to support other types of DNS, e.g. DNS-over-TLS. Therefore, DnsStats is introduced to manage the statistics in a more general way. DoT statistics is now available from DnsStats and is shown in dumpsys dnsresolver. Example of output from dumpsys dnsresolver: Server statistics: (total, RTT avg, {rcode:counts}, last update) over UDP 8.8.4.4 <no data> 8.8.8.8 <no data> 2001:4860:4860::8844 (7, 2201ms, [NOERROR:4 TIMEOUT:3 ], 2s) 2001:4860:4860::8888 (3, 11ms, [NOERROR:3 ], 4s) over TLS <no server> over TCP 8.8.4.4 <no data> 8.8.8.8 <no data> 2001:4860:4860::8844 <no data> 2001:4860:4860::8888 <no data> Bug: 140286585 Test: atest --include-subdirs packages/modules/DnsResolver Test: checked output in dumpsys dnsresolver Change-Id: I73f0108d5e9bb493cf7eda68252f5a0922149a98
* Make private DNS connect timeout configurableMike Yu2019-10-091-3/+3
| | | | | | | | | | | | | | | | | | It could take time to connect to a private DNS server if the system allows 6 syn-retransmissions (net.ipv4.tcp_syn_retries = 6), which can take time more than 2 minutes. This change allows us to configure the timeout value via dnsresolver binder service, and keep the default timeout value the same as the original design. Bug: 120182528 Bug: 141218721 Test: atest --include-subdirs packages/modules/DnsResolver Test: m com.android.resolv adb install com.android.resolv rebooted Change-Id: I8711a31172cfc671bf348191db363e7863831470
* Fix setResolverConfiguration to return negative error codeMike Yu2019-10-051-2/+2
| | | | | | | | | | | | | | This fixes the logging bug in dumpsys netd. For example, when resolv_set_nameservers fails: It used to print setResolverConfiguration() -> ServiceSpecificException(-22, "Unknown error -22") <0.18ms> After the fix, it prints setResolverConfiguration() -> ServiceSpecificException(22, "Invalid argument") <0.28ms> Test: m com.android.resolv Change-Id: I916e6e31dcdd2f421592e8ca71663ffbddc7b3b5
* Resolv: Enable clang-tidy and fix all warningschenbruce2019-09-061-2/+1
| | | | | | | Bug: 140539187 Test: built, flashed, booted, check warnings Test: atest Change-Id: Ifa56f5536c6efb49ea3c74cb011f7c2fd952db32
* Remove ExternalPrivateDnsStatusMike Yu2019-08-211-15/+10
| | | | | | | | | | ExternalPrivateDnsStatus was introduced for C-compatible version of getStatus(), and now it's no more needed. Bug: 130686826 Test: atest --include-subdirs packages/modules/DnsResolver Test: dumpsys dnsresolver showed correct output Change-Id: Iac50908f269d8921f1aadba8f2b50286a33325f7