summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXiao Ma <xiaom@google.com>2020-05-19 11:10:48 +0000
committerXiao Ma <xiaom@google.com>2020-05-19 13:34:57 +0000
commit46028eec0b2d7f157fa555893355d5b8601ffc6b (patch)
tree391a674e723ff67d0bb5d37775055725a11d2a5f /src
parent1f20cb6617d30e0f6a788a29ba1827881c09b3b8 (diff)
Adjust the timeout parameters in DHCP client.
MAX_TIMEOUT_MS: 128s -> 512s, battery drain for DHCP packet retransmit. FIRST_TIMEOUT_MS: 2s -> 1s, shorten DHCP packet retransmit interval. DEFAULT_TIMEOUT_MS: 36s -> 18s, quickly detect provisioning timeout. Bug: 131781810 Test: atest NetworkStackIntegrationTests NetworkStackTests Merged-In: Ie162b0d59da0082cd0c5ec02bb391c3d27f40607 Change-Id: Ie162b0d59da0082cd0c5ec02bb391c3d27f40607
Diffstat (limited to 'src')
-rw-r--r--src/android/net/dhcp/DhcpClient.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/android/net/dhcp/DhcpClient.java b/src/android/net/dhcp/DhcpClient.java
index 6d48c0c..caac155 100644
--- a/src/android/net/dhcp/DhcpClient.java
+++ b/src/android/net/dhcp/DhcpClient.java
@@ -149,8 +149,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
@@ -198,8 +198,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.