Make iptables -L and -S calls wait for xtables lock
(cherry picked from commit 99b40503edccae74d0917b9d1e17a5939ac7193b)
Bug:22802665
Change-Id: Ief59212ab976af940887508fab706b5be07005c6
diff --git a/server/BandwidthController.cpp b/server/BandwidthController.cpp
index d656fe8..d71ce3b 100644
--- a/server/BandwidthController.cpp
+++ b/server/BandwidthController.cpp
@@ -1249,7 +1249,7 @@
* 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 @@
/* 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));