Don't use Fwmark to rename threads
Use the least 16 significant bits, which are supposed to represent
netId, of the network mark for resolver threads name. This is in
preparation for dropping Fwmark used in DnsResolver.
No naming rule change.
Bug: 151895202
Test: adb shell ps -AT $(adb shell pidof netd)
Change-Id: Ie1724dc5775cdeff6ee00a51b5f74e8f8a32d5d3
diff --git a/Dns64Configuration.cpp b/Dns64Configuration.cpp
index 64c491c..1208d10 100644
--- a/Dns64Configuration.cpp
+++ b/Dns64Configuration.cpp
@@ -37,11 +37,13 @@
namespace android {
+using android::base::StringPrintf;
using android::net::NetworkDnsEventReported;
using netdutils::DumpWriter;
using netdutils::IPAddress;
using netdutils::IPPrefix;
using netdutils::ScopedAddrinfo;
+using netdutils::setThreadName;
namespace net {
@@ -64,7 +66,7 @@
// Note that capturing |cfg| in this lambda creates a copy.
std::thread discovery_thread([this, cfg, netId] {
- netdutils::setThreadName(android::base::StringPrintf("Nat64Pfx_%u", netId).c_str());
+ setThreadName(StringPrintf("Nat64Pfx_%u", netId).c_str());
// Make a mutable copy rather than mark the whole lambda mutable.
// No particular reason.