diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-06-04 04:20:31 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-04 04:20:31 +0000 |
commit | 3c993e886f288e7a68a9ff4a65e0e55882a3e09c (patch) | |
tree | d7d6baf4c18d72a84c3299a03274772ee06b7ed9 | |
parent | 3145c53bf4096ef564c3366d57db2a16e426bc0b (diff) | |
parent | 4e5fe665af9b247e662ded53157d9055459d8f34 (diff) |
Merge "Adjust the timeout parameters in DHCP client." into rvc-dev am: 43fc3e16d5 am: 4e5fe665af
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/11544897
Change-Id: Ibfaef880b77038f08819f9ef6e59bb0ac778a2b6
-rw-r--r-- | common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java | 6 | ||||
-rw-r--r-- | src/android/net/dhcp/DhcpClient.java | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java b/common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java index cb613fb..5f5699c 100644 --- a/common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java +++ b/common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java @@ -68,12 +68,12 @@ public class ProvisioningConfiguration { // TODO: Delete this default timeout once those callers that care are // fixed to pass in their preferred timeout. // - // We pick 36 seconds so we can send DHCP requests at + // We pick 18 seconds so we can send DHCP requests at // - // t=0, t=2, t=6, t=14, t=30 + // t=0, t=1, t=3, t=7, t=16 // // allowing for 10% jitter. - private static final int DEFAULT_TIMEOUT_MS = 36 * 1000; + private static final int DEFAULT_TIMEOUT_MS = 18 * 1000; /** * Builder to create a {@link ProvisioningConfiguration}. diff --git a/src/android/net/dhcp/DhcpClient.java b/src/android/net/dhcp/DhcpClient.java index 011cbaf..e19ac79 100644 --- a/src/android/net/dhcp/DhcpClient.java +++ b/src/android/net/dhcp/DhcpClient.java @@ -151,8 +151,8 @@ public class DhcpClient extends StateMachine { // Timers and timeouts. private static final int SECONDS = 1000; - private static final int FIRST_TIMEOUT_MS = 2 * SECONDS; - private static final int MAX_TIMEOUT_MS = 128 * SECONDS; + private static final int FIRST_TIMEOUT_MS = 1 * SECONDS; + private static final int MAX_TIMEOUT_MS = 512 * SECONDS; private static final int IPMEMORYSTORE_TIMEOUT_MS = 1 * SECONDS; // The waiting time to restart the DHCP configuration process after broadcasting a @@ -200,8 +200,8 @@ public class DhcpClient extends StateMachine { // This is not strictly needed, since the client is asynchronous and implements exponential // backoff. It's maintained for backwards compatibility with the previous DHCP code, which was - // a blocking operation with a 30-second timeout. We pick 36 seconds so we can send packets at - // t=0, t=2, t=6, t=14, t=30, allowing for 10% jitter. + // a blocking operation with a 30-second timeout. We pick 18 seconds so we can send packets at + // t=0, t=1, t=3, t=7, t=16, allowing for 10% jitter. private static final int DHCP_TIMEOUT_MS = 36 * SECONDS; // DhcpClient uses IpClient's handler. |