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/oem_iptables_hook.cpp b/server/oem_iptables_hook.cpp
index 70260f3..7e4b3cb 100644
--- a/server/oem_iptables_hook.cpp
+++ b/server/oem_iptables_hook.cpp
@@ -37,6 +37,7 @@
static bool oemCleanupHooks() {
const char *cmd1[] = {
IPTABLES_PATH,
+ "-w",
"-F",
"oem_out"
};
@@ -44,6 +45,7 @@
const char *cmd2[] = {
IPTABLES_PATH,
+ "-w",
"-F",
"oem_fwd"
};
@@ -51,6 +53,7 @@
const char *cmd3[] = {
IPTABLES_PATH,
+ "-w",
"-t",
"nat",
"-F",