diff options
author | Samuel Holland <samuel.holland@sifive.com> | 2023-10-03 12:22:13 -0700 |
---|---|---|
committer | Samuel Holland <samuel.holland@sifive.com> | 2024-02-12 21:17:12 +0000 |
commit | 4a09f65b86c6520195403b7fb52f5b6d255f6227 (patch) | |
tree | 95199c2cb5290fc5b3924ebd9bb62ef6cc717e48 | |
parent | 995728e1519408ad8f44183f389ec7e97535e580 (diff) | |
download | netd-4a09f65b86c6520195403b7fb52f5b6d255f6227.tar.gz |
Respect HwTimeoutMultiplier in IptablesRestoreController
On slow hardware, iptables calls may take longer than 5 seconds.
Provide a way to increase the timeout in these scenarios.
Change-Id: I759f6de705fa81ccaa910738869f69875d88b4ca
-rw-r--r-- | server/IptablesRestoreController.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/IptablesRestoreController.cpp b/server/IptablesRestoreController.cpp index dc718309..d0aaa638 100644 --- a/server/IptablesRestoreController.cpp +++ b/server/IptablesRestoreController.cpp @@ -22,8 +22,9 @@ #include <sys/wait.h> #include <unistd.h> -#include <android-base/logging.h> #include <android-base/file.h> +#include <android-base/logging.h> +#include <android-base/properties.h> #include <netdutils/Syscalls.h> #include "Controllers.h" @@ -41,7 +42,7 @@ constexpr size_t PING_SIZE = sizeof(PING) - 1; // Not compile-time constants because they are changed by the unit tests. int IptablesRestoreController::MAX_RETRIES = 50; -int IptablesRestoreController::POLL_TIMEOUT_MS = 100; +int IptablesRestoreController::POLL_TIMEOUT_MS = 100 * android::base::HwTimeoutMultiplier(); class IptablesProcess { public: |