summaryrefslogtreecommitdiff
path: root/server/TetherController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/TetherController.cpp')
-rw-r--r--server/TetherController.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index 62dcbbf1..7d7be581 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -325,11 +325,10 @@ bool TetherController::isTetheringStarted() {
// dnsmasq can't parse commands larger than this due to the fixed-size buffer
// in check_android_listeners(). The receiving buffer is 1024 bytes long, but
// dnsmasq reads up to 1023 bytes.
-#define MAX_CMD_SIZE 1023
+const size_t MAX_CMD_SIZE = 1023;
+// TODO: convert callers to the overload taking a vector<string>
int TetherController::setDnsForwarders(unsigned netId, char **servers, int numServers) {
- int i;
-
Fwmark fwmark;
fwmark.netId = netId;
fwmark.explicitlySelected = true;
@@ -339,7 +338,7 @@ int TetherController::setDnsForwarders(unsigned netId, char **servers, int numSe
std::string daemonCmd = StringPrintf("update_dns%s0x%x", SEPARATOR, fwmark.intValue);
mDnsForwarders.clear();
- for (i = 0; i < numServers; i++) {
+ for (int i = 0; i < numServers; i++) {
ALOGD("setDnsForwarders(0x%x %d = '%s')", fwmark.intValue, i, servers[i]);
addrinfo *res, hints = { .ai_flags = AI_NUMERICHOST };