Loading DnsProxyListener.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -727,9 +727,9 @@ void DnsProxyListener::GetAddrInfoHandler::doDns64Synthesis(int32_t* rv, addrinf } void DnsProxyListener::GetAddrInfoHandler::run() { LOG(DEBUG) << "GetAddrInfoHandler::run: {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; LOG(INFO) << "GetAddrInfoHandler::run: {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; addrinfo* result = nullptr; Stopwatch s; Loading Loading @@ -902,9 +902,9 @@ DnsProxyListener::ResNSendHandler::ResNSendHandler(SocketClient* c, std::string : Handler(c), mMsg(std::move(msg)), mFlags(flags), mNetContext(netcontext) {} void DnsProxyListener::ResNSendHandler::run() { LOG(DEBUG) << "ResNSendHandler::run: " << mFlags << " / {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; LOG(INFO) << "ResNSendHandler::run: " << mFlags << " / {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; Stopwatch s; maybeFixupNetContext(&mNetContext, mClient->getPid()); Loading DnsResolver.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -31,8 +31,9 @@ bool resolv_init(const ResolverNetdCallbacks* callbacks) { android::base::InitLogging(/*argv=*/nullptr); LOG(INFO) << __func__ << ": Initializing resolver"; resolv_set_log_severity(android::base::WARNING); doh_init_logger(DOH_LOG_LEVEL_WARN); const bool isDebug = isUserDebugBuild(); resolv_set_log_severity(isDebug ? android::base::INFO : android::base::WARNING); doh_init_logger(isDebug ? DOH_LOG_LEVEL_INFO : DOH_LOG_LEVEL_WARN); using android::net::gApiLevel; gApiLevel = getApiLevel(); using android::net::gResNetdCallbacks; Loading Experiments.h +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ class Experiments { "doh_idle_timeout_ms", "doh_session_resumption", "mdns_resolution", "max_queries_global", }; // This value is used in updateInternal as the default value if any flags can't be found. static constexpr int kFlagIntDefault = INT_MIN; Loading OperationLimiter.h +12 −7 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ #include <android-base/logging.h> #include <android-base/thread_annotations.h> #include "Experiments.h" namespace android { namespace netdutils { Loading @@ -43,8 +45,7 @@ namespace netdutils { template <typename KeyType> class OperationLimiter { public: OperationLimiter(int limitPerKey, int globalLimit = INT_MAX) : mLimitPerKey(limitPerKey), mGlobalLimit(globalLimit) {} OperationLimiter(int limitPerKey) : mLimitPerKey(limitPerKey) {} ~OperationLimiter() { DCHECK(mCounters.empty()) << "Destroying OperationLimiter with active operations"; Loading @@ -57,15 +58,22 @@ class OperationLimiter { // finish(key). bool start(KeyType key) EXCLUDES(mMutex) { std::lock_guard lock(mMutex); if (mGlobalCounter >= mGlobalLimit) { int globalLimit = android::net::Experiments::getInstance()->getFlag("max_queries_global", INT_MAX); if (globalLimit < mLimitPerKey) { LOG(ERROR) << "Misconfiguration on max_queries_global " << globalLimit; globalLimit = INT_MAX; } if (mGlobalCounter >= globalLimit) { // Oh, no! LOG(ERROR) << "Query from " << key << " denied due to global limit: " << globalLimit; return false; } auto& cnt = mCounters[key]; // operator[] creates new entries as needed. if (cnt >= mLimitPerKey) { // Oh, no! LOG(ERROR) << "Query from " << key << " denied due to limit: " << mLimitPerKey; return false; } Loading Loading @@ -109,9 +117,6 @@ class OperationLimiter { // Maximum number of outstanding queries from a single key. const int mLimitPerKey; // Maximum number of outstanding queries, globally. const int mGlobalLimit; }; } // namespace netdutils Loading apex/manifest.json +1 −1 Original line number Diff line number Diff line { "name": "com.android.resolv", "version": 319999900 "version": 330000000 } Loading
DnsProxyListener.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -727,9 +727,9 @@ void DnsProxyListener::GetAddrInfoHandler::doDns64Synthesis(int32_t* rv, addrinf } void DnsProxyListener::GetAddrInfoHandler::run() { LOG(DEBUG) << "GetAddrInfoHandler::run: {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; LOG(INFO) << "GetAddrInfoHandler::run: {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; addrinfo* result = nullptr; Stopwatch s; Loading Loading @@ -902,9 +902,9 @@ DnsProxyListener::ResNSendHandler::ResNSendHandler(SocketClient* c, std::string : Handler(c), mMsg(std::move(msg)), mFlags(flags), mNetContext(netcontext) {} void DnsProxyListener::ResNSendHandler::run() { LOG(DEBUG) << "ResNSendHandler::run: " << mFlags << " / {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; LOG(INFO) << "ResNSendHandler::run: " << mFlags << " / {" << mNetContext.app_netid << " " << mNetContext.app_mark << " " << mNetContext.dns_netid << " " << mNetContext.dns_mark << " " << mNetContext.uid << " " << mNetContext.flags << "}"; Stopwatch s; maybeFixupNetContext(&mNetContext, mClient->getPid()); Loading
DnsResolver.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -31,8 +31,9 @@ bool resolv_init(const ResolverNetdCallbacks* callbacks) { android::base::InitLogging(/*argv=*/nullptr); LOG(INFO) << __func__ << ": Initializing resolver"; resolv_set_log_severity(android::base::WARNING); doh_init_logger(DOH_LOG_LEVEL_WARN); const bool isDebug = isUserDebugBuild(); resolv_set_log_severity(isDebug ? android::base::INFO : android::base::WARNING); doh_init_logger(isDebug ? DOH_LOG_LEVEL_INFO : DOH_LOG_LEVEL_WARN); using android::net::gApiLevel; gApiLevel = getApiLevel(); using android::net::gResNetdCallbacks; Loading
Experiments.h +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ class Experiments { "doh_idle_timeout_ms", "doh_session_resumption", "mdns_resolution", "max_queries_global", }; // This value is used in updateInternal as the default value if any flags can't be found. static constexpr int kFlagIntDefault = INT_MIN; Loading
OperationLimiter.h +12 −7 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ #include <android-base/logging.h> #include <android-base/thread_annotations.h> #include "Experiments.h" namespace android { namespace netdutils { Loading @@ -43,8 +45,7 @@ namespace netdutils { template <typename KeyType> class OperationLimiter { public: OperationLimiter(int limitPerKey, int globalLimit = INT_MAX) : mLimitPerKey(limitPerKey), mGlobalLimit(globalLimit) {} OperationLimiter(int limitPerKey) : mLimitPerKey(limitPerKey) {} ~OperationLimiter() { DCHECK(mCounters.empty()) << "Destroying OperationLimiter with active operations"; Loading @@ -57,15 +58,22 @@ class OperationLimiter { // finish(key). bool start(KeyType key) EXCLUDES(mMutex) { std::lock_guard lock(mMutex); if (mGlobalCounter >= mGlobalLimit) { int globalLimit = android::net::Experiments::getInstance()->getFlag("max_queries_global", INT_MAX); if (globalLimit < mLimitPerKey) { LOG(ERROR) << "Misconfiguration on max_queries_global " << globalLimit; globalLimit = INT_MAX; } if (mGlobalCounter >= globalLimit) { // Oh, no! LOG(ERROR) << "Query from " << key << " denied due to global limit: " << globalLimit; return false; } auto& cnt = mCounters[key]; // operator[] creates new entries as needed. if (cnt >= mLimitPerKey) { // Oh, no! LOG(ERROR) << "Query from " << key << " denied due to limit: " << mLimitPerKey; return false; } Loading Loading @@ -109,9 +117,6 @@ class OperationLimiter { // Maximum number of outstanding queries from a single key. const int mLimitPerKey; // Maximum number of outstanding queries, globally. const int mGlobalLimit; }; } // namespace netdutils Loading
apex/manifest.json +1 −1 Original line number Diff line number Diff line { "name": "com.android.resolv", "version": 319999900 "version": 330000000 }