summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/os/INetworkManagementService.aidl5
-rw-r--r--services/java/com/android/server/NetworkManagementService.java14
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java14
3 files changed, 27 insertions, 6 deletions
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index 0440923..4e5645d 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -74,6 +74,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
*/
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 349b4d2..c517965 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -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 {
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 3b29d40..e0598a7 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -1917,15 +1917,17 @@ public class WifiStateMachine extends StateMachine {
Log.e(TAG, "Failed to reload STA firmware " + e);
// continue
}
- //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 {
+ 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.
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()) {