Skip to content

Commit

Permalink
Add "metered" flag to DHCP offer vendor info.
Browse files Browse the repository at this point in the history
Bug: 6344821
Change-Id: Ic8cd235a1cbdd848ff839f6f0f03161de2090751
  • Loading branch information
jsharkey committed Apr 19, 2012
1 parent 745e09f commit 6df79da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions TetherController.cpp
Expand Up @@ -134,15 +134,17 @@ int TetherController::startTethering(int num_addrs, struct in_addr* addrs) {
close(pipefd[0]);
}

int num_processed_args = 4 + (num_addrs/2) + 1; // 1 null for termination
int num_processed_args = 5 + (num_addrs/2) + 1; // 1 null for termination
char **args = (char **)malloc(sizeof(char *) * num_processed_args);
args[num_processed_args - 1] = NULL;
args[0] = (char *)"/system/bin/dnsmasq";
args[1] = (char *)"--no-daemon";
args[2] = (char *)"--no-resolv";
args[3] = (char *)"--no-poll";
// TODO: pipe through metered status from ConnService
args[4] = (char *)"--dhcp-option-force=43,ANDROID_METERED";

int nextArg = 4;
int nextArg = 5;
for (int addrIndex=0; addrIndex < num_addrs;) {
char *start = strdup(inet_ntoa(addrs[addrIndex++]));
char *end = strdup(inet_ntoa(addrs[addrIndex++]));
Expand Down

0 comments on commit 6df79da

Please sign in to comment.