Add "metered" flag to DHCP offer vendor info.
Bug: 6344821
Change-Id: Ic8cd235a1cbdd848ff839f6f0f03161de2090751
diff --git a/TetherController.cpp b/TetherController.cpp
index 8b1ecc8..9ff1bc4 100644
--- a/TetherController.cpp
+++ b/TetherController.cpp
@@ -134,15 +134,17 @@
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++]));