Make netd calls to iptables wait for xtables lock
Without this wait iptables commands can fail with various unpleasant
consequences like Log.wtf() or missing iptables rules. The most
critical calls to iptables in NetdConstants.cpp already wait for the
lock.
Bug:22802665
Change-Id: I7d542c3d4f0e005618e368da674159b90d652c8a
diff --git a/server/IdletimerController.cpp b/server/IdletimerController.cpp
index ae7ae04..e6306fd 100644
--- a/server/IdletimerController.cpp
+++ b/server/IdletimerController.cpp
@@ -154,6 +154,7 @@
int res;
const char *cmd1[] = {
NULL, // To be filled inside runIpxtablesCmd
+ "-w",
"-t",
"raw",
"-F",
@@ -166,6 +167,7 @@
const char *cmd2[] = {
NULL, // To be filled inside runIpxtablesCmd
+ "-w",
"-t",
"mangle",
"-F",
@@ -201,6 +203,7 @@
const char *cmd1[] = {
NULL, // To be filled inside runIpxtablesCmd
+ "-w",
"-t",
"raw",
(op == IptOpAdd) ? "-A" : "-D",
@@ -223,6 +226,7 @@
const char *cmd2[] = {
NULL, // To be filled inside runIpxtablesCmd
+ "-w",
"-t",
"mangle",
(op == IptOpAdd) ? "-A" : "-D",