diff options
author | Luis Vidal <lvidal@cyngn.com> | 2016-07-29 12:44:43 -0700 |
---|---|---|
committer | Luis Vidal <lvidal@cyngn.com> | 2016-08-12 10:20:59 -0700 |
commit | 4e55de7d395ae2a0e5ec7d832cdda85dc545a89f (patch) | |
tree | 8bef0f3f9f5c2a231688888d0fe98f5bb23d63ae | |
parent | 4128d747663997f343d21eb0a140cd2b9e767196 (diff) | |
download | android_system_netd-stable/cm-13.0-ZNH2K.tar.gz android_system_netd-stable/cm-13.0-ZNH2K.tar.bz2 android_system_netd-stable/cm-13.0-ZNH2K.zip |
Enforces bandwidth limit on portable access pointstable/cm-13.0-ZNH2K
If user sets a bandwith limit for cellular data, we need to enforce
that limit on portable access point as well.
Change-Id: I8a82a11626ceb3264be9f24e52e472d2f37d315f
TICKET: CYNGNOS-3157
(cherry picked from commit 11825d1e3b3e2372f60e33b4071ddf26d9275557)
-rw-r--r-- | server/BandwidthController.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/BandwidthController.cpp b/server/BandwidthController.cpp index 85b1f5b7..4f9e33ea 100644 --- a/server/BandwidthController.cpp +++ b/server/BandwidthController.cpp @@ -692,6 +692,13 @@ int BandwidthController::prepCostlyIface(const char *ifn, QuotaType quotaType) { snprintf(cmd, sizeof(cmd), "-I bw_OUTPUT %d -o %s --jump %s", ruleInsertPos, ifn, costCString); res |= runIpxtablesCmd(cmd, IptJumpNoAdd); + + snprintf(cmd, sizeof(cmd), "-D bw_FORWARD -i %s --jump %s", ifn, costCString); + runIpxtablesCmd(cmd, IptJumpNoAdd, IptFailHide); + + snprintf(cmd, sizeof(cmd), "-I bw_FORWARD %d -i %s --jump %s", ruleInsertPos, ifn, costCString); + res |= runIpxtablesCmd(cmd, IptJumpNoAdd); + return res; } |