summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-08-04 13:27:28 +0900
committerLorenzo Colitti <lorenzo@google.com>2015-08-04 14:54:10 +0900
commit0e47a8aae62e79d80db150bdde3298a100ab2d03 (patch)
tree642474f25d3004f9a2887e3a3964b96d0f44e05f
parent399830a4096b343dfd5e7f83c43e8241a2c98513 (diff)
downloadethernet-0e47a8aae62e79d80db150bdde3298a100ab2d03.tar.gz
Stop DHCP if it times out.
This was not necessary in L, but it is necessary after https://partner-android-review.googlesource.com/#/c/205415/ . Bug: 22936203 Change-Id: I24a96c33e5bb375f36217a1c2cec2076eb5ac8b4
-rw-r--r--java/com/android/server/ethernet/EthernetNetworkFactory.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/com/android/server/ethernet/EthernetNetworkFactory.java b/java/com/android/server/ethernet/EthernetNetworkFactory.java
index 0c4f57d..4503197 100644
--- a/java/com/android/server/ethernet/EthernetNetworkFactory.java
+++ b/java/com/android/server/ethernet/EthernetNetworkFactory.java
@@ -262,7 +262,7 @@ class EthernetNetworkFactory {
// TODO: Handle DHCP renew.
Thread dhcpThread = new Thread(new Runnable() {
public void run() {
- if (DBG) Log.i(TAG, "dhcpThread(+" + mIface + "): mNetworkInfo=" + mNetworkInfo);
+ if (DBG) Log.i(TAG, "dhcpThread(" + mIface + "): mNetworkInfo=" + mNetworkInfo);
LinkProperties linkProperties;
IpConfiguration config = mEthernetManager.getConfiguration();
@@ -287,6 +287,9 @@ class EthernetNetworkFactory {
// set our score lower than any network could go
// so we get dropped.
mFactory.setScoreFilter(-1);
+ // If DHCP timed out (as opposed to failing), the DHCP client will still be
+ // running, because in M we changed its timeout to infinite. Stop it now.
+ NetworkUtils.stopDhcp(mIface);
return;
}
linkProperties = dhcpResults.toLinkProperties(mIface);