diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2014-11-19 16:11:53 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2014-12-13 02:44:24 -0800 |
commit | 3cdeed26ede36f93775fe19255b5d3112a3888ff (patch) | |
tree | 8146431b5da924378ba2fb929e224c136a2a6863 | |
parent | 8e0f4b69b70b9a90c6973042c2ae773e0fb070ce (diff) | |
download | android_system_netd-3cdeed26ede36f93775fe19255b5d3112a3888ff.tar.gz android_system_netd-3cdeed26ede36f93775fe19255b5d3112a3888ff.tar.bz2 android_system_netd-3cdeed26ede36f93775fe19255b5d3112a3888ff.zip |
netd: fix concurrency error during iptables execution
When multiple userspace processes run iptables commands concurrently,
some of the commands fail with the following error
08:40:59.164 I/ip6tables( 2308): Another app is currently holding the
xtables lock. Perhaps you want to use the -w option?
08:40:59.165 I/ip6tables( 2308): ip6tables terminated by exit(4)
This is because Iptables uses the xtables lock to handle concurrency.
If the -w option is not used, iptables will exit immediately once it
fails to acquire that lock and this can cause the framework to hang.
CRs-Fixed: 722552
Change-Id: I92281abd5d05745899f9aa3b7fceca31082c47aa
-rw-r--r-- | server/BandwidthController.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/BandwidthController.cpp b/server/BandwidthController.cpp index 2cff7939..023008e5 100644 --- a/server/BandwidthController.cpp +++ b/server/BandwidthController.cpp @@ -136,20 +136,20 @@ const char *BandwidthController::IPT_CLEANUP_COMMANDS[] = { }; const char *BandwidthController::IPT_SETUP_COMMANDS[] = { - "-N bw_happy_box", - "-N bw_penalty_box", - "-N bw_costly_shared", + "-w -N bw_happy_box", + "-w -N bw_penalty_box", + "-w -N bw_costly_shared", }; const char *BandwidthController::IPT_BASIC_ACCOUNTING_COMMANDS[] = { - "-A bw_INPUT -m owner --socket-exists", /* This is a tracking rule. */ + "-w -A bw_INPUT -m owner --socket-exists", /* This is a tracking rule. */ - "-A bw_OUTPUT -m owner --socket-exists", /* This is a tracking rule. */ + "-w -A bw_OUTPUT -m owner --socket-exists", /* This is a tracking rule. */ - "-A bw_costly_shared --jump bw_penalty_box", + "-w -A bw_costly_shared --jump bw_penalty_box", - "-t raw -A bw_raw_PREROUTING -m owner --socket-exists", /* This is a tracking rule. */ - "-t mangle -A bw_mangle_POSTROUTING -m owner --socket-exists", /* This is a tracking rule. */ + "-w -t raw -A bw_raw_PREROUTING -m owner --socket-exists", /* This is a tracking rule. */ + "-w -t mangle -A bw_mangle_POSTROUTING -m owner --socket-exists", /* This is a tracking rule. */ }; BandwidthController::BandwidthController(void) { |