Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 723e8aad authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8285583 from 5cfbd508 to mainline-extservices-release

Change-Id: I1dccfdb02a36905a14da220b49215b7b95ea9fb7
parents 8786e2b3 5cfbd508
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@

namespace android {

using android::net::NetworkDnsEventReported;
using netdutils::DumpWriter;
using netdutils::IPAddress;
using netdutils::IPPrefix;
+11 −7
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@
using aidl::android::net::metrics::INetdEventListener;
using aidl::android::net::resolv::aidl::DnsHealthEventParcel;
using aidl::android::net::resolv::aidl::IDnsResolverUnsolicitedEventListener;
using android::net::NetworkDnsEventReported;
using std::span;

namespace android {
@@ -333,7 +332,8 @@ void maybeLogQuery(int eventType, const android_net_context& netContext,
void reportDnsEvent(int eventType, const android_net_context& netContext, int latencyUs,
                    int returnCode, NetworkDnsEventReported& event, const std::string& query_name,
                    const std::vector<std::string>& ip_addrs = {}, int total_ip_addr_count = 0) {
    uint32_t rate = (query_name.ends_with(".local") &&
    uint32_t rate =
            (query_name.ends_with(".local") && is_mdns_supported_network(netContext.dns_netid) &&
             android::net::Experiments::getInstance()->getFlag("mdns_resolution", 1))
                    ? getDnsEventSubsamplingRate(netContext.dns_netid, returnCode, true)
                    : getDnsEventSubsamplingRate(netContext.dns_netid, returnCode, false);
@@ -1159,7 +1159,9 @@ void DnsProxyListener::GetHostByNameHandler::run() {
    event.set_latency_micros(latencyUs);
    event.set_event_type(EVENT_GETHOSTBYNAME);

    LOG(DEBUG) << "GetHostByNameHandler::run: result: " << gai_strerror(rv);
    if (rv) {
        LOG(DEBUG) << "GetHostByNameHandler::run: result failed: " << gai_strerror(rv);
    }

    bool success = true;
    if (hp) {
@@ -1314,7 +1316,9 @@ void DnsProxyListener::GetHostByAddrHandler::run() {
    event.set_latency_micros(latencyUs);
    event.set_event_type(EVENT_GETHOSTBYADDR);

    LOG(DEBUG) << "GetHostByAddrHandler::run: result: " << gai_strerror(rv);
    if (rv) {
        LOG(DEBUG) << "GetHostByAddrHandler::run: result failed: " << gai_strerror(rv);
    }

    bool success = true;
    if (hp) {
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@

namespace android {

using android::net::Experiments;
using netdutils::enableSockopt;
using netdutils::enableTcpKeepAlives;
using netdutils::isOk;
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ class Experiments {
            "doh_query_timeout_ms",
            "doh_probe_timeout_ms",
            "doh_idle_timeout_ms",
            "doh_session_resumption",
            "mdns_resolution",
    };
    // This value is used in updateInternal as the default value if any flags can't be found.
+12 −5
Original line number Diff line number Diff line
@@ -500,13 +500,20 @@ int PrivateDnsConfiguration::setDoh(int32_t netId, uint32_t mark,
        LOG(INFO) << __func__ << ": Upgrading server to DoH: " << name;
        resolv_stats_set_addrs(netId, PROTO_DOH, {dohId.ipAddr}, kDohPort);

        auto probeTimeout = getTimeoutFromFlag("doh_probe_timeout_ms", kDohProbeDefaultTimeoutMs);
        auto idleTimeout = getTimeoutFromFlag("doh_idle_timeout_ms", kDohIdleDefaultTimeoutMs);
        LOG(DEBUG) << __func__ << ": probeTimeout " << probeTimeout << ", idleTimeout "
                   << idleTimeout;
        const FeatureFlags flags = {
                .probe_timeout_ms =
                        getTimeoutFromFlag("doh_probe_timeout_ms", kDohProbeDefaultTimeoutMs),
                .idle_timeout_ms =
                        getTimeoutFromFlag("doh_idle_timeout_ms", kDohIdleDefaultTimeoutMs),
                .use_session_resumption =
                        Experiments::getInstance()->getFlag("doh_session_resumption", 0) == 1,
        };
        LOG(DEBUG) << __func__ << ": probe_timeout_ms=" << flags.probe_timeout_ms
                   << ", idle_timeout_ms=" << flags.idle_timeout_ms
                   << ", use_session_resumption=" << flags.use_session_resumption;

        return doh_net_new(mDohDispatcher, netId, dohId.httpsTemplate.c_str(), dohId.host.c_str(),
                           dohId.ipAddr.c_str(), mark, caCert.c_str(), probeTimeout, idleTimeout);
                           dohId.ipAddr.c_str(), mark, caCert.c_str(), &flags);
    }

    LOG(INFO) << __func__ << ": No suitable DoH server found";
Loading