commit | 82ae84b9490e898eb839d0b807de23da27437c5b | [log] [tgz] |
---|---|---|
author | Mike Yu <yumike@google.com> | Wed Dec 02 21:04:40 2020 +0800 |
committer | Mike Yu <yumike@google.com> | Mon Apr 26 03:10:44 2021 +0000 |
tree | f356d3612e202044d1c5fb7d0080978e9f770c2c | |
parent | 9310ca2278d55dc53b7173ed21b85d1b523057da [diff] |
Implement DoT revalidation The revalidation starts from DnsTlsDispatcher which uses a counter for counting the number of continuous network_error failures of a DoT server. The mechanics works for private DNS opportunistic mode. - Once the counter reaches dot_revalidation_threshold, DnsTlsDispatcher sends a revalidation request to PrivateDnsConfiguration to validate the DoT server. - Once the counter reaches dot_xport_unusable_threshold, DnsTlsDispatcher marks the transport of the DoT server as unusable. The DoT server won't be used for at least 5 minutes. DoT revalidation runs when the followings are met: [1] the private DNS setting is opportunistic mode [2] the requested DoT server is valid to be used on the network [3] the requested DoT server is currently marked as Validation::success The above mechanics runs when the feature flag "dot_revalidation_threshold" is a positive and zon-zero value, and is -1 when the mechanics is disabled. Bug: 79727473 Test: atest when all the flags off dot_revalidation_threshold: -1 dot_async_handshake: 0 dot_xport_unusable_threshold: -1 dot_maxtries: 3 parallel_lookup_sleep_time: 2 dot_connect_timeout_ms: 127000 parallel_lookup_release: 0 sort_nameservers: 0 keep_listening_udp: 0 Test: atest when all the flags on dot_revalidation_threshold: 10 dot_async_handshake: 1 dot_xport_unusable_threshold: 20 dot_maxtries: 1 parallel_lookup_sleep_time: 2 dot_connect_timeout_ms: 10000 parallel_lookup_release: 1 sort_nameservers: 1 keep_listening_udp: 1 Change-Id: Id442529468d63156a9aebf30ea5f142dfa689a97
This code uses LOG(X) for logging. Log levels are VERBOSE,DEBUG,INFO,WARNING and ERROR. The default setting is WARNING and logs relate to WARNING and ERROR will be shown. If you want to enable the DEBUG level logs, using following command. adb shell service call dnsresolver 10 i32 1 VERBOSE 0 DEBUG 1 INFO 2 WARNING 3 ERROR 4 Verbose resolver logs could contain PII -- do NOT enable in production builds.