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

Commit 62e61d73 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Add support to change IPv6 privacy extensions"

parents 149cecdc 7329361c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -73,6 +73,11 @@ interface INetworkManagementService
     */
    void setInterfaceUp(String iface);

    /**
     * Set interface IPv6 privacy extensions
     */
    void setInterfaceIpv6PrivacyExtensions(String iface, boolean enable);

    /**
     * Retrieves the network routes currently configured on the specified
     * interface
+14 −0
Original line number Diff line number Diff line
@@ -480,6 +480,20 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        }
    }

    public void setInterfaceIpv6PrivacyExtensions(String iface, boolean enable)
            throws IllegalStateException {
        String cmd = String.format("interface ipv6privacyextensions %s %s", iface,
                enable ? "enable" : "disable");
        try {
            mConnector.doCommand(cmd);
        } catch (NativeDaemonConnectorException e) {
            throw new IllegalStateException(
                    "Unable to communicate with native daemon to set ipv6privacyextensions - " + e);
        }
    }



    /* TODO: This is right now a IPv4 only function. Works for wifi which loses its
       IPv6 addresses on interface down, but we need to do full clean up here */
    public void clearInterfaceAddresses(String iface) throws IllegalStateException {
+8 −6
Original line number Diff line number Diff line
@@ -1917,15 +1917,17 @@ public class WifiStateMachine extends StateMachine {
                        Log.e(TAG, "Failed to reload STA firmware " + e);
                        // continue
                    }
                   try {
                       //A runtime crash can leave the interface up and
                       //this affects connectivity when supplicant starts up.
                       //Ensure interface is down before a supplicant start.
                    try {
                        mNwService.setInterfaceDown(mInterfaceName);
                        //Set privacy extensions
                        mNwService.setInterfaceIpv6PrivacyExtensions(mInterfaceName, true);
                    } catch (RemoteException re) {
                        if (DBG) Log.w(TAG, "Unable to bring down wlan interface: " + re);
                        if (DBG) Log.w(TAG, "Unable to change interface settings: " + re);
                    } catch (IllegalStateException ie) {
                        if (DBG) Log.w(TAG, "Unable to bring down wlan interface: " + ie);
                        if (DBG) Log.w(TAG, "Unable to change interface settings: " + ie);
                    }

                    if(WifiNative.startSupplicant()) {