From 4e55de7d395ae2a0e5ec7d832cdda85dc545a89f Mon Sep 17 00:00:00 2001 From: Luis Vidal Date: Fri, 29 Jul 2016 12:44:43 -0700 Subject: Enforces bandwidth limit on portable access point 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) --- server/BandwidthController.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- cgit v1.2.3