summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Holland <samuel.holland@sifive.com>2023-10-03 12:22:13 -0700
committerSamuel Holland <samuel.holland@sifive.com>2024-02-12 21:17:12 +0000
commit4a09f65b86c6520195403b7fb52f5b6d255f6227 (patch)
tree95199c2cb5290fc5b3924ebd9bb62ef6cc717e48
parent995728e1519408ad8f44183f389ec7e97535e580 (diff)
downloadnetd-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.cpp5
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: