Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c60967fd authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android (Google) Code Review
Browse files

Merge "Don't update routes if Dhcp fails." into jb-mr2-dev

parents b91e50c2 28cdf1dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ public class DhcpStateMachine extends StateMachine {
        } else if (dhcpAction == DhcpAction.RENEW) {
            if (DBG) Log.d(TAG, "DHCP renewal on " + mInterfaceName);
            success = NetworkUtils.runDhcpRenew(mInterfaceName, dhcpResults);
            dhcpResults.updateFromDhcpRequest(mDhcpResults);
            if (success) dhcpResults.updateFromDhcpRequest(mDhcpResults);
        }
        if (success) {
            if (DBG) Log.d(TAG, "DHCP succeeded on " + mInterfaceName);
+4 −0
Original line number Diff line number Diff line
@@ -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);