Don't update routes if Dhcp fails.

bug:8377625
Change-Id: I11d2c29728078813bfb1245cc46e8cce2b307a2c
This commit is contained in:
Robert Greenwalt
2013-03-15 10:48:46 -07:00
parent a37623584e
commit 0c0db62a64

View File

@@ -136,6 +136,10 @@ static jboolean android_net_utils_runDhcpCommon(JNIEnv* env, jobject clazz, jstr
result = ::dhcp_do_request(nameStr, ipaddr, gateway, &prefixLength,
dns, server, &lease, vendorInfo, domains);
}
if (result != 0) {
ALOGD("dhcp_do_request failed");
}
env->ReleaseStringUTFChars(ifname, nameStr);
if (result == 0) {
env->CallVoidMethod(dhcpResults, dhcpResultsFieldIds.clear);