Implementation of control flags in asynchronous DNS query API
Flags definitions are in multinetwork.h
Test: built, flashed, booted
system/netd/tests/runtests.sh passes
Change-Id: Iab1983b783d1470bc1cf23489abbef7a2d88e860
diff --git a/client/NetdClient.cpp b/client/NetdClient.cpp
index 5586347..d22b5b2 100644
--- a/client/NetdClient.cpp
+++ b/client/NetdClient.cpp
@@ -394,7 +394,7 @@
return resNetworkSend(netId, buf.data(), len, flags);
}
-extern "C" int resNetworkSend(unsigned netId, const uint8_t* msg, size_t msglen, uint32_t) {
+extern "C" int resNetworkSend(unsigned netId, const uint8_t* msg, size_t msglen, uint32_t flags) {
// Encode
// Base 64 encodes every 3 bytes into 4 characters, but then adds padding to the next
// multiple of 4 and a \0
@@ -409,7 +409,8 @@
}
// Send
netId = getNetworkForResolv(netId);
- const std::string cmd = "resnsend " + encodedQuery + " " + std::to_string(netId) + '\0';
+ const std::string cmd = "resnsend " + std::to_string(netId) + " " + std::to_string(flags) +
+ " " + encodedQuery + '\0';
if (cmd.size() > MAX_CMD_SIZE) {
// Cmd size must less than buffer size of FrameworkListener
return -EMSGSIZE;