Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 17 | #define LOG_TAG "ResolverController" |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 18 | |
| 19 | #include "ResolverController.h" |
| 20 | |
| 21 | #include <set> |
| 22 | #include <string> |
| 23 | #include <vector> |
| 24 | |
| 25 | #include <netdb.h> |
| 26 | |
Luke Huang | f4c98f2 | 2019-06-14 01:57:00 +0800 | [diff] [blame] | 27 | #include <Fwmark.h> |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 28 | #include <aidl/android/net/IDnsResolver.h> |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 29 | #include <android-base/logging.h> |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 30 | #include <android-base/strings.h> |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 31 | |
| 32 | #include "Dns64Configuration.h" |
| 33 | #include "DnsResolver.h" |
Bernie Innocenti | 23c6e2a | 2019-05-16 15:18:35 +0900 | [diff] [blame] | 34 | #include "PrivateDnsConfiguration.h" |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 35 | #include "ResolverEventReporter.h" |
| 36 | #include "ResolverStats.h" |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 37 | #include "netd_resolv/stats.h" |
Bernie Innocenti | e71a28a | 2019-05-29 00:42:35 +0900 | [diff] [blame] | 38 | #include "resolv_cache.h" |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 39 | |
waynema | 3725518 | 2019-03-18 13:22:56 +0800 | [diff] [blame] | 40 | using aidl::android::net::ResolverParamsParcel; |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 41 | |
| 42 | namespace android { |
| 43 | |
| 44 | using netdutils::DumpWriter; |
| 45 | |
| 46 | namespace net { |
| 47 | |
| 48 | namespace { |
| 49 | |
| 50 | std::string addrToString(const sockaddr_storage* addr) { |
| 51 | char out[INET6_ADDRSTRLEN] = {0}; |
| 52 | getnameinfo((const sockaddr*)addr, sizeof(sockaddr_storage), out, INET6_ADDRSTRLEN, nullptr, 0, |
| 53 | NI_NUMERICHOST); |
| 54 | return std::string(out); |
| 55 | } |
| 56 | |
| 57 | const char* getPrivateDnsModeString(PrivateDnsMode mode) { |
| 58 | switch (mode) { |
| 59 | case PrivateDnsMode::OFF: |
| 60 | return "OFF"; |
| 61 | case PrivateDnsMode::OPPORTUNISTIC: |
| 62 | return "OPPORTUNISTIC"; |
| 63 | case PrivateDnsMode::STRICT: |
| 64 | return "STRICT"; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | constexpr const char* validationStatusToString(Validation value) { |
| 69 | switch (value) { |
| 70 | case Validation::in_process: |
| 71 | return "in_process"; |
| 72 | case Validation::success: |
| 73 | return "success"; |
| 74 | case Validation::fail: |
| 75 | return "fail"; |
| 76 | case Validation::unknown_server: |
| 77 | return "unknown_server"; |
| 78 | case Validation::unknown_netid: |
| 79 | return "unknown_netid"; |
| 80 | default: |
| 81 | return "unknown_status"; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void sendNat64PrefixEvent(const Dns64Configuration::Nat64PrefixInfo& args) { |
| 86 | const auto& listeners = ResolverEventReporter::getInstance().getListeners(); |
| 87 | if (listeners.size() == 0) { |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 88 | LOG(ERROR) << __func__ << ": No available listener. dropping NAT64 prefix event"; |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 89 | return; |
| 90 | } |
| 91 | for (const auto& it : listeners) { |
| 92 | it->onNat64PrefixEvent(args.netId, args.added, args.prefixString, args.prefixLength); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | int getDnsInfo(unsigned netId, std::vector<std::string>* servers, std::vector<std::string>* domains, |
| 97 | res_params* params, std::vector<android::net::ResolverStats>* stats, |
| 98 | std::vector<int32_t>* wait_for_pending_req_timeout_count) { |
| 99 | using aidl::android::net::IDnsResolver; |
| 100 | using android::net::ResolverStats; |
| 101 | static_assert(ResolverStats::STATS_SUCCESSES == IDnsResolver::RESOLVER_STATS_SUCCESSES && |
| 102 | ResolverStats::STATS_ERRORS == IDnsResolver::RESOLVER_STATS_ERRORS && |
| 103 | ResolverStats::STATS_TIMEOUTS == IDnsResolver::RESOLVER_STATS_TIMEOUTS && |
| 104 | ResolverStats::STATS_INTERNAL_ERRORS == |
| 105 | IDnsResolver::RESOLVER_STATS_INTERNAL_ERRORS && |
| 106 | ResolverStats::STATS_RTT_AVG == IDnsResolver::RESOLVER_STATS_RTT_AVG && |
| 107 | ResolverStats::STATS_LAST_SAMPLE_TIME == |
| 108 | IDnsResolver::RESOLVER_STATS_LAST_SAMPLE_TIME && |
| 109 | ResolverStats::STATS_USABLE == IDnsResolver::RESOLVER_STATS_USABLE && |
| 110 | ResolverStats::STATS_COUNT == IDnsResolver::RESOLVER_STATS_COUNT, |
| 111 | "AIDL and ResolverStats.h out of sync"); |
| 112 | int nscount = -1; |
| 113 | sockaddr_storage res_servers[MAXNS]; |
| 114 | int dcount = -1; |
| 115 | char res_domains[MAXDNSRCH][MAXDNSRCHPATH]; |
| 116 | res_stats res_stats[MAXNS]; |
| 117 | servers->clear(); |
| 118 | domains->clear(); |
| 119 | *params = res_params{}; |
| 120 | stats->clear(); |
| 121 | int res_wait_for_pending_req_timeout_count; |
| 122 | int revision_id = android_net_res_stats_get_info_for_net( |
| 123 | netId, &nscount, res_servers, &dcount, res_domains, params, res_stats, |
| 124 | &res_wait_for_pending_req_timeout_count); |
| 125 | |
| 126 | // If the netId is unknown (which can happen for valid net IDs for which no DNS servers have |
| 127 | // yet been configured), there is no revision ID. In this case there is no data to return. |
| 128 | if (revision_id < 0) { |
| 129 | return 0; |
| 130 | } |
| 131 | |
| 132 | // Verify that the returned data is sane. |
| 133 | if (nscount < 0 || nscount > MAXNS || dcount < 0 || dcount > MAXDNSRCH) { |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 134 | LOG(ERROR) << __func__ << ": nscount = " << nscount << ", dcount = " << dcount; |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 135 | return -ENOTRECOVERABLE; |
| 136 | } |
| 137 | |
| 138 | // Determine which servers are considered usable by the resolver. |
| 139 | bool valid_servers[MAXNS]; |
| 140 | std::fill_n(valid_servers, MAXNS, false); |
| 141 | android_net_res_stats_get_usable_servers(params, res_stats, nscount, valid_servers); |
| 142 | |
| 143 | // Convert the server sockaddr structures to std::string. |
| 144 | stats->resize(nscount); |
| 145 | for (int i = 0; i < nscount; ++i) { |
| 146 | char hbuf[NI_MAXHOST]; |
| 147 | int rv = |
| 148 | getnameinfo(reinterpret_cast<const sockaddr*>(&res_servers[i]), |
| 149 | sizeof(res_servers[i]), hbuf, sizeof(hbuf), nullptr, 0, NI_NUMERICHOST); |
| 150 | std::string server_str; |
| 151 | if (rv == 0) { |
| 152 | server_str.assign(hbuf); |
| 153 | } else { |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 154 | LOG(ERROR) << "getnameinfo() failed for server #" << i << ": " << gai_strerror(rv); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 155 | server_str.assign("<invalid>"); |
| 156 | } |
| 157 | servers->push_back(std::move(server_str)); |
| 158 | android::net::ResolverStats& cur_stats = (*stats)[i]; |
| 159 | android_net_res_stats_aggregate(&res_stats[i], &cur_stats.successes, &cur_stats.errors, |
| 160 | &cur_stats.timeouts, &cur_stats.internal_errors, |
| 161 | &cur_stats.rtt_avg, &cur_stats.last_sample_time); |
| 162 | cur_stats.usable = valid_servers[i]; |
| 163 | } |
| 164 | |
| 165 | // Convert the stack-allocated search domain strings to std::string. |
| 166 | for (int i = 0; i < dcount; ++i) { |
| 167 | domains->push_back(res_domains[i]); |
| 168 | } |
| 169 | |
| 170 | (*wait_for_pending_req_timeout_count)[0] = res_wait_for_pending_req_timeout_count; |
| 171 | return 0; |
| 172 | } |
| 173 | |
| 174 | } // namespace |
| 175 | |
| 176 | ResolverController::ResolverController() |
| 177 | : mDns64Configuration( |
| 178 | [](uint32_t netId, uint32_t uid, android_net_context* netcontext) { |
| 179 | gResNetdCallbacks.get_network_context(netId, uid, netcontext); |
| 180 | }, |
chenbruce | 99cbfd8 | 2019-09-05 15:08:13 +0800 | [diff] [blame] | 181 | std::bind(sendNat64PrefixEvent, std::placeholders::_1)) {} |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 182 | |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 183 | void ResolverController::destroyNetworkCache(unsigned netId) { |
| 184 | LOG(VERBOSE) << __func__ << ": netId = " << netId; |
| 185 | |
Luke Huang | 5bd827c | 2019-03-14 16:10:04 +0800 | [diff] [blame] | 186 | resolv_delete_cache_for_net(netId); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 187 | mDns64Configuration.stopPrefixDiscovery(netId); |
Mike Yu | 88640bd | 2019-04-15 19:49:18 +0800 | [diff] [blame] | 188 | gPrivateDnsConfiguration.clear(netId); |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | int ResolverController::createNetworkCache(unsigned netId) { |
| 192 | LOG(VERBOSE) << __func__ << ": netId = " << netId; |
| 193 | |
| 194 | return resolv_create_cache_for_net(netId); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 195 | } |
| 196 | |
waynema | 0e73c2e | 2019-07-31 15:04:08 +0800 | [diff] [blame] | 197 | int ResolverController::setResolverConfiguration(const ResolverParamsParcel& resolverParams) { |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 198 | using aidl::android::net::IDnsResolver; |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 199 | |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 200 | // At private DNS validation time, we only know the netId, so we have to guess/compute the |
| 201 | // corresponding socket mark. |
| 202 | Fwmark fwmark; |
waynema | 3725518 | 2019-03-18 13:22:56 +0800 | [diff] [blame] | 203 | fwmark.netId = resolverParams.netId; |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 204 | fwmark.explicitlySelected = true; |
| 205 | fwmark.protectedFromVpn = true; |
| 206 | fwmark.permission = PERMISSION_SYSTEM; |
| 207 | |
Mike Yu | 94626e0 | 2019-04-15 19:45:07 +0800 | [diff] [blame] | 208 | // Allow at most MAXNS private DNS servers in a network to prevent too many broken servers. |
| 209 | std::vector<std::string> tlsServers = resolverParams.tlsServers; |
| 210 | if (tlsServers.size() > MAXNS) { |
| 211 | tlsServers.resize(MAXNS); |
| 212 | } |
Mike Yu | a772c20 | 2019-09-23 17:47:21 +0800 | [diff] [blame] | 213 | const int err = gPrivateDnsConfiguration.set( |
| 214 | resolverParams.netId, fwmark.intValue, tlsServers, resolverParams.tlsName, |
| 215 | resolverParams.caCertificate, resolverParams.tlsConnectTimeoutMs); |
waynema | 0e73c2e | 2019-07-31 15:04:08 +0800 | [diff] [blame] | 216 | |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 217 | if (err != 0) { |
| 218 | return err; |
| 219 | } |
| 220 | |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 221 | res_params res_params = {}; |
waynema | 3725518 | 2019-03-18 13:22:56 +0800 | [diff] [blame] | 222 | res_params.sample_validity = resolverParams.sampleValiditySeconds; |
| 223 | res_params.success_threshold = resolverParams.successThreshold; |
| 224 | res_params.min_samples = resolverParams.minSamples; |
| 225 | res_params.max_samples = resolverParams.maxSamples; |
| 226 | res_params.base_timeout_msec = resolverParams.baseTimeoutMsec; |
| 227 | res_params.retry_count = resolverParams.retryCount; |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 228 | |
Mike Yu | 65b4e5b | 2019-10-05 10:47:13 +0800 | [diff] [blame] | 229 | return resolv_set_nameservers(resolverParams.netId, resolverParams.servers, |
| 230 | resolverParams.domains, res_params); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | int ResolverController::getResolverInfo(int32_t netId, std::vector<std::string>* servers, |
| 234 | std::vector<std::string>* domains, |
| 235 | std::vector<std::string>* tlsServers, |
| 236 | std::vector<int32_t>* params, std::vector<int32_t>* stats, |
| 237 | std::vector<int32_t>* wait_for_pending_req_timeout_count) { |
| 238 | using aidl::android::net::IDnsResolver; |
| 239 | using android::net::ResolverStats; |
| 240 | res_params res_params; |
| 241 | std::vector<ResolverStats> res_stats; |
| 242 | int ret = getDnsInfo(netId, servers, domains, &res_params, &res_stats, |
| 243 | wait_for_pending_req_timeout_count); |
| 244 | if (ret != 0) { |
| 245 | return ret; |
| 246 | } |
| 247 | |
| 248 | // Serialize the information for binder. |
| 249 | ResolverStats::encodeAll(res_stats, stats); |
| 250 | |
Mike Yu | 3e82906 | 2019-08-07 14:01:14 +0800 | [diff] [blame] | 251 | const auto privateDnsStatus = gPrivateDnsConfiguration.getStatus(netId); |
| 252 | for (const auto& pair : privateDnsStatus.serversMap) { |
| 253 | tlsServers->push_back(addrToString(&pair.first.ss)); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | params->resize(IDnsResolver::RESOLVER_PARAMS_COUNT); |
| 257 | (*params)[IDnsResolver::RESOLVER_PARAMS_SAMPLE_VALIDITY] = res_params.sample_validity; |
| 258 | (*params)[IDnsResolver::RESOLVER_PARAMS_SUCCESS_THRESHOLD] = res_params.success_threshold; |
| 259 | (*params)[IDnsResolver::RESOLVER_PARAMS_MIN_SAMPLES] = res_params.min_samples; |
| 260 | (*params)[IDnsResolver::RESOLVER_PARAMS_MAX_SAMPLES] = res_params.max_samples; |
| 261 | (*params)[IDnsResolver::RESOLVER_PARAMS_BASE_TIMEOUT_MSEC] = res_params.base_timeout_msec; |
| 262 | (*params)[IDnsResolver::RESOLVER_PARAMS_RETRY_COUNT] = res_params.retry_count; |
| 263 | return 0; |
| 264 | } |
| 265 | |
| 266 | void ResolverController::startPrefix64Discovery(int32_t netId) { |
| 267 | mDns64Configuration.startPrefixDiscovery(netId); |
| 268 | } |
| 269 | |
| 270 | void ResolverController::stopPrefix64Discovery(int32_t netId) { |
| 271 | return mDns64Configuration.stopPrefixDiscovery(netId); |
| 272 | } |
| 273 | |
| 274 | // TODO: use StatusOr<T> to wrap the result. |
| 275 | int ResolverController::getPrefix64(unsigned netId, netdutils::IPPrefix* prefix) { |
| 276 | netdutils::IPPrefix p = mDns64Configuration.getPrefix64(netId); |
| 277 | if (p.family() != AF_INET6 || p.length() == 0) { |
Luke Huang | 9b80e6c | 2019-04-09 17:54:09 +0800 | [diff] [blame] | 278 | LOG(ERROR) << "No valid NAT64 prefix (" << netId << ", " << p.toString().c_str() << ")"; |
| 279 | |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 280 | return -ENOENT; |
| 281 | } |
| 282 | *prefix = p; |
| 283 | return 0; |
| 284 | } |
| 285 | |
| 286 | void ResolverController::dump(DumpWriter& dw, unsigned netId) { |
| 287 | // No lock needed since Bionic's resolver locks all accessed data structures internally. |
| 288 | using android::net::ResolverStats; |
| 289 | std::vector<std::string> servers; |
| 290 | std::vector<std::string> domains; |
| 291 | res_params params = {}; |
| 292 | std::vector<ResolverStats> stats; |
| 293 | std::vector<int32_t> wait_for_pending_req_timeout_count(1, 0); |
| 294 | time_t now = time(nullptr); |
| 295 | int rv = getDnsInfo(netId, &servers, &domains, ¶ms, &stats, |
| 296 | &wait_for_pending_req_timeout_count); |
| 297 | dw.incIndent(); |
| 298 | if (rv != 0) { |
| 299 | dw.println("getDnsInfo() failed for netid %u", netId); |
| 300 | } else { |
| 301 | if (servers.empty()) { |
| 302 | dw.println("No DNS servers defined"); |
| 303 | } else { |
Luke Huang | e126fbe | 2019-07-20 17:36:30 +0800 | [diff] [blame] | 304 | dw.println("DnsEvent subsampling map: " + |
| 305 | android::base::Join(resolv_cache_dump_subsampling_map(netId), ' ')); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 306 | dw.println( |
| 307 | "DNS servers: # IP (total, successes, errors, timeouts, internal errors, " |
| 308 | "RTT avg, last sample)"); |
| 309 | dw.incIndent(); |
| 310 | for (size_t i = 0; i < servers.size(); ++i) { |
| 311 | if (i < stats.size()) { |
| 312 | const ResolverStats& s = stats[i]; |
| 313 | int total = s.successes + s.errors + s.timeouts + s.internal_errors; |
| 314 | if (total > 0) { |
| 315 | int time_delta = (s.last_sample_time > 0) ? now - s.last_sample_time : -1; |
| 316 | dw.println("%s (%d, %d, %d, %d, %d, %dms, %ds)%s", servers[i].c_str(), |
| 317 | total, s.successes, s.errors, s.timeouts, s.internal_errors, |
| 318 | s.rtt_avg, time_delta, s.usable ? "" : " BROKEN"); |
| 319 | } else { |
| 320 | dw.println("%s <no data>", servers[i].c_str()); |
| 321 | } |
| 322 | } else { |
| 323 | dw.println("%s <no stats>", servers[i].c_str()); |
| 324 | } |
| 325 | } |
| 326 | dw.decIndent(); |
| 327 | } |
| 328 | if (domains.empty()) { |
| 329 | dw.println("No search domains defined"); |
| 330 | } else { |
| 331 | std::string domains_str = android::base::Join(domains, ", "); |
| 332 | dw.println("search domains: %s", domains_str.c_str()); |
| 333 | } |
| 334 | if (params.sample_validity != 0) { |
| 335 | dw.println( |
| 336 | "DNS parameters: sample validity = %us, success threshold = %u%%, " |
| 337 | "samples (min, max) = (%u, %u), base_timeout = %dmsec, retry count = " |
| 338 | "%dtimes", |
| 339 | params.sample_validity, params.success_threshold, params.min_samples, |
| 340 | params.max_samples, params.base_timeout_msec, params.retry_count); |
| 341 | } |
| 342 | |
| 343 | mDns64Configuration.dump(dw, netId); |
Mike Yu | 3e82906 | 2019-08-07 14:01:14 +0800 | [diff] [blame] | 344 | const auto privateDnsStatus = gPrivateDnsConfiguration.getStatus(netId); |
lifr | 9498178 | 2019-05-17 21:15:19 +0800 | [diff] [blame] | 345 | dw.println("Private DNS mode: %s", getPrivateDnsModeString(privateDnsStatus.mode)); |
Mike Yu | 3e82906 | 2019-08-07 14:01:14 +0800 | [diff] [blame] | 346 | if (privateDnsStatus.serversMap.size() == 0) { |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 347 | dw.println("No Private DNS servers configured"); |
| 348 | } else { |
Mike Yu | 3e82906 | 2019-08-07 14:01:14 +0800 | [diff] [blame] | 349 | dw.println("Private DNS configuration (%u entries)", |
| 350 | static_cast<uint32_t>(privateDnsStatus.serversMap.size())); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 351 | dw.incIndent(); |
Mike Yu | 3e82906 | 2019-08-07 14:01:14 +0800 | [diff] [blame] | 352 | for (const auto& pair : privateDnsStatus.serversMap) { |
| 353 | dw.println("%s name{%s} status{%s}", addrToString(&pair.first.ss).c_str(), |
| 354 | pair.first.name.c_str(), validationStatusToString(pair.second)); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 355 | } |
| 356 | dw.decIndent(); |
| 357 | } |
| 358 | dw.println("Concurrent DNS query timeout: %d", wait_for_pending_req_timeout_count[0]); |
Mike Yu | e655b1d | 2019-08-28 17:49:59 +0800 | [diff] [blame] | 359 | resolv_stats_dump(dw, netId); |
Luke Huang | 7b26b20 | 2019-03-28 14:09:24 +0800 | [diff] [blame] | 360 | } |
| 361 | dw.decIndent(); |
| 362 | } |
| 363 | |
| 364 | } // namespace net |
| 365 | } // namespace android |