From 1d28fef92e516b0144d7844413194ba9e953b317 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 14 Jun 2012 11:16:14 -0700 Subject: [PATCH] Stop any running DHCP client before bringup up an Ethernet interface If the system server is restarted, the dhcpcd_eth0 service may have already been started by the previous system server, and the new system server's attempts to start the dhcpcd will do nothing. Change-Id: Icfd480a5369eb9c7dfe86b43190294871a915529 --- core/java/android/net/EthernetDataTracker.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/android/net/EthernetDataTracker.java b/core/java/android/net/EthernetDataTracker.java index b1dd62cf67cfe..c7f2c99923b1d 100644 --- a/core/java/android/net/EthernetDataTracker.java +++ b/core/java/android/net/EthernetDataTracker.java @@ -221,6 +221,10 @@ public class EthernetDataTracker implements NetworkStateTracker { mNetworkInfo.setExtraInfo(mHwAddr); } } + + // if a DHCP client had previously been started for this interface, then stop it + NetworkUtils.stopDhcp(mIface); + reconnect(); break; }