Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcd1c8b1 authored by Xiao Ma's avatar Xiao Ma
Browse files

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.
Change-Id: I9d214e193a4f80a9512a3a6f385ca3554f050386
parent d9e033d0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ public class DhcpClient extends StateMachine {
    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;
    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();
        }