summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorBram Bonné <brambonne@google.com>2020-06-03 08:07:47 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-03 08:07:47 +0000
commit95fcc62009e2b1ffa339672830c3deb1e5604b72 (patch)
tree8615d952c42d3466ab3a4400598e52f7148bf0e5 /service
parentc5bd4191e2952427f8d8f3c313beaaa6d8542edd (diff)
parentedd8833275a5b7b750b2a58fa7c323b45b86b961 (diff)
Merge "Use EUI64 IPv6 link-local address generation when randomizing MAC" into rvc-dev am: edd8833275
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/net/wifi/+/11689262 Change-Id: Ie080f6d65c4e6cdc3925c827f6b3b87afb750841
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java30
1 files changed, 20 insertions, 10 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index 5b616dd0a..b5bd479db 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -6447,12 +6447,17 @@ public class ClientModeImpl extends StateMachine {
final boolean isUsingStaticIp =
(config.getIpAssignment() == IpConfiguration.IpAssignment.STATIC);
+ final boolean isUsingMacRandomization =
+ config.macRandomizationSetting
+ == WifiConfiguration.RANDOMIZATION_PERSISTENT
+ && isConnectedMacRandomizationEnabled();
if (mVerboseLoggingEnabled) {
final String key = config.getKey();
log("startIpClient netId=" + Integer.toString(mLastNetworkId)
+ " " + key + " "
+ " roam=" + mIsAutoRoaming
+ " static=" + isUsingStaticIp
+ + " randomMac=" + isUsingMacRandomization
+ " isFilsConnection=" + isFilsConnection);
}
@@ -6471,15 +6476,18 @@ public class ClientModeImpl extends StateMachine {
return false;
}
setConfigurationsPriorToIpClientProvisioning(config);
- final ProvisioningConfiguration prov =
+ final ProvisioningConfiguration.Builder prov =
new ProvisioningConfiguration.Builder()
.withPreDhcpAction()
.withPreconnection()
.withApfCapabilities(
mWifiNative.getApfCapabilities(mInterfaceName))
- .withLayer2Information(layer2Info)
- .build();
- mIpClient.startProvisioning(prov);
+ .withLayer2Information(layer2Info);
+ if (isUsingMacRandomization) {
+ // Use EUI64 address generation for link-local IPv6 addresses.
+ prov.withRandomMacAddress();
+ }
+ mIpClient.startProvisioning(prov.build());
} else {
sendNetworkChangeBroadcast(DetailedState.OBTAINING_IPADDR);
// We must clear the config BSSID, as the wifi chipset may decide to roam
@@ -6521,7 +6529,7 @@ public class ClientModeImpl extends StateMachine {
}
}
- final ProvisioningConfiguration prov;
+ final ProvisioningConfiguration.Builder prov;
ProvisioningConfiguration.ScanResultInfo scanResultInfo = null;
if (scanResult != null) {
final List<ScanResultInfo.InformationElement> ies =
@@ -6542,8 +6550,7 @@ public class ClientModeImpl extends StateMachine {
.withNetwork(getCurrentNetwork())
.withDisplayName(config.SSID)
.withScanResultInfo(scanResultInfo)
- .withLayer2Information(layer2Info)
- .build();
+ .withLayer2Information(layer2Info);
} else {
StaticIpConfiguration staticIpConfig = config.getStaticIpConfiguration();
prov = new ProvisioningConfiguration.Builder()
@@ -6551,10 +6558,13 @@ public class ClientModeImpl extends StateMachine {
.withApfCapabilities(mWifiNative.getApfCapabilities(mInterfaceName))
.withNetwork(getCurrentNetwork())
.withDisplayName(config.SSID)
- .withLayer2Information(layer2Info)
- .build();
+ .withLayer2Information(layer2Info);
+ }
+ if (isUsingMacRandomization) {
+ // Use EUI64 address generation for link-local IPv6 addresses.
+ prov.withRandomMacAddress();
}
- mIpClient.startProvisioning(prov);
+ mIpClient.startProvisioning(prov.build());
}
return true;