From 33893d68d4a30ad79d8c31b3f1a41f58c234d3db Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Fri, 17 Aug 2018 13:21:25 +0900 Subject: [PATCH] Strategic fix for infinite loop Bug: 111326363 Test: Manual + atest frameworks-net Change-Id: Id262df4e41de5c74784637ae4a5459c3fab9fb74 --- .../android/server/ethernet/EthernetNetworkFactory.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java index dc42d4b0f7..dc94482bfd 100644 --- a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java +++ b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java @@ -33,6 +33,7 @@ import android.net.NetworkSpecifier; import android.net.StringNetworkSpecifier; import android.net.ip.IpClient; import android.net.ip.IpClient.ProvisioningConfiguration; +import android.net.util.InterfaceParams; import android.os.Handler; import android.text.TextUtils; import android.util.Log; @@ -328,7 +329,11 @@ public class EthernetNetworkFactory extends NetworkFactory { // This cannot happen due to provisioning timeout, because our timeout is 0. It can only // happen if we're provisioned and we lose provisioning. stop(); - start(); + // If the interface has disappeared provisioning will fail over and over again, so + // there is no point in starting again + if (null != InterfaceParams.getByName(name)) { + start(); + } } void updateLinkProperties(LinkProperties linkProperties) {