summaryrefslogtreecommitdiff
path: root/src/android/net/dhcp/DhcpClient.java
diff options
context:
space:
mode:
authorXiao Ma <xiaom@google.com>2020-06-02 13:36:28 +0000
committerXiao Ma <xiaom@google.com>2020-06-03 04:17:49 +0000
commit859a591a5690e80fd88511db1c054e6a4be9b10e (patch)
treee1824ffd5fff05e4df180325e2bf31646165968d /src/android/net/dhcp/DhcpClient.java
parentb4167ae242b6bfa0b4032b321b007a54cc476edc (diff)
Shorten the timeout of DHCP INIT-REBOOT state.
Currently the timeout in the INIT-REBOOT state is 18s which allows 4 retransmits. In the scenario where DHCP server fails to response due to certain reason, DhcpClient should go back to INIT state ASAP and do the regular DHCPDISCOVER. Shorten the timeout to 5s to speed up the fallback process. Bug: 157960451 Bug: 157603386 Test: atest NetworkStackIntegrationTests Test: manual test to verify that client goes back to INIT state and broadcasts DHCPDISCOVER after 2 retransmissions. Merged-In: I9d214e193a4f80a9512a3a6f385ca3554f050386 Change-Id: I9d214e193a4f80a9512a3a6f385ca3554f050386
Diffstat (limited to 'src/android/net/dhcp/DhcpClient.java')
-rw-r--r--src/android/net/dhcp/DhcpClient.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/android/net/dhcp/DhcpClient.java b/src/android/net/dhcp/DhcpClient.java
index 011cbaf..a644dd9 100644
--- a/src/android/net/dhcp/DhcpClient.java
+++ b/src/android/net/dhcp/DhcpClient.java
@@ -154,6 +154,7 @@ public class DhcpClient extends StateMachine {
private static final int FIRST_TIMEOUT_MS = 2 * SECONDS;
private static final int MAX_TIMEOUT_MS = 128 * SECONDS;
private static final int IPMEMORYSTORE_TIMEOUT_MS = 1 * SECONDS;
+ private static final int DHCP_INITREBOOT_TIMEOUT_MS = 5 * SECONDS;
// The waiting time to restart the DHCP configuration process after broadcasting a
// DHCPDECLINE message, (RFC2131 3.1.5 describes client SHOULD wait a minimum of 10
@@ -1814,6 +1815,7 @@ public class DhcpClient extends StateMachine {
class DhcpInitRebootState extends DhcpRequestingState {
@Override
public void enter() {
+ mTimeout = DHCP_INITREBOOT_TIMEOUT_MS;
super.enter();
startNewTransaction();
}