diff options
| author | Bernie Innocenti <codewiz@google.com> | 2018-12-04 14:57:48 +0900 |
|---|---|---|
| committer | Bernie Innocenti <codewiz@google.com> | 2019-01-08 20:49:23 +0900 |
| commit | 45238a1fea63c7f310b8d65137f231b7917ca2bd (patch) | |
| tree | 011a230c2a93e7f9e0eea3ccf3c6d355079fd540 /server/TetherController.cpp | |
| parent | 4231c5414cdef91a6f2f0d43ba549c8f2960075b (diff) | |
Enable -Wsign-compare for netd and fix warnings
Test: atest netd_unit_test netd_integration_test resolv_integration_test
Change-Id: I84347de8f3a3ec0dcc8979037b9c265d145a35f7
Diffstat (limited to 'server/TetherController.cpp')
| -rw-r--r-- | server/TetherController.cpp | 7 |
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 }; |
