OSDN Git Service

Make iptables -L and -S calls wait for xtables lock
authorYusuke Sato <yusukes@google.com>
Wed, 19 Aug 2015 20:47:30 +0000 (13:47 -0700)
committerYusuke Sato <yusukes@google.com>
Wed, 19 Aug 2015 21:22:12 +0000 (14:22 -0700)
Bug:22802665
Change-Id: I95b83ec0a926208e20659ad4b5355cf8500821f5

server/BandwidthController.cpp

index e5cf36c..8795f7c 100644 (file)
@@ -1249,7 +1249,7 @@ int BandwidthController::getTetherStats(SocketClient *cli, TetherStats &stats, s
      * the wanted info.
      */
     fullCmd = IPTABLES_PATH;
-    fullCmd += " -nvx -L ";
+    fullCmd += " -nvx -w -L ";
     fullCmd += NatController::LOCAL_TETHER_COUNTERS_CHAIN;
     iptOutput = popen(fullCmd.c_str(), "r");
     if (!iptOutput) {
@@ -1270,7 +1270,7 @@ void BandwidthController::flushExistingCostlyTables(bool doClean) {
 
     /* Only lookup ip4 table names as ip6 will have the same tables ... */
     fullCmd = IPTABLES_PATH;
-    fullCmd += " -S";
+    fullCmd += " -w -S";
     iptOutput = popen(fullCmd.c_str(), "r");
     if (!iptOutput) {
             ALOGE("Failed to run %s err=%s", fullCmd.c_str(), strerror(errno));