diff options
author | Xiao Ma <xiaom@google.com> | 2019-11-18 17:44:18 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2019-11-25 09:58:37 +0000 |
commit | e419da7deeb985f3306064f0a942eceaa462acf8 (patch) | |
tree | f24bcfd1490bd8f0220baeb7e2e33a0888084a5e /src | |
parent | d53b4053df403e61ad8b6349561731e1ca51a4ab (diff) |
Notify IpClient DHCP process success when entering DHCP Bound State.
After introducing IP address conflict detection mechanism, we might get
an duplicated IP address though the DHCP handshake, it's not appropriate
to notify IpClient that DHCP success and configure interface with this IP
address immediately. However, Bound State ensures that we have already
done DAD (if enabled) and IP address has been configured on the interface.
More reasonable to notify IpClient DHCP success when entering Bound state.
This CL does not change the behaviour of a successful transaction.
The call graph is:
- notifySuccess
- acceptDhcpResults
- when receiving an ACK in DhcpReacquiringState
- next action: transition to DhcpBoundState
- called from confirmDhcpLease
- when receiving a rapid commit ACK in DhcpInitState
- next action: ConfiguringInterfaceState
- next action: configure link address, then transition to DhcpBoundState
- when receiving an ACK in DhcpRequestingState
- next action: ConfiguringInterfaceState
- next action: configure link address, then transition to DhcpBoundState
This CL does change the behaviour of failed transactions. For example,
if configuring the IP address or opening the UDP socket fails, after
this CL, the client will no longer notify success. This is more correct.
Bug: 130775067
Test: atest NetworkStackTests NetworkStackIntegrationTests
Change-Id: Ie3b5edd8ddf04aac258b97ecaa291fcb25611bbd
Diffstat (limited to 'src')
-rw-r--r-- | src/android/net/dhcp/DhcpClient.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/android/net/dhcp/DhcpClient.java b/src/android/net/dhcp/DhcpClient.java index 889bfce..9e24ca8 100644 --- a/src/android/net/dhcp/DhcpClient.java +++ b/src/android/net/dhcp/DhcpClient.java @@ -638,7 +638,6 @@ public class DhcpClient extends StateMachine { } mOffer = null; Log.d(TAG, msg + " lease: " + mDhcpLease); - notifySuccess(); } private void clearDhcpState() { @@ -1150,6 +1149,7 @@ public class DhcpClient extends StateMachine { transitionTo(mStoppedState); } + notifySuccess(); scheduleLeaseTimers(); logTimeToBoundState(); } |