summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-03-05 19:12:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-03-05 19:12:10 +0000
commit6811e70e9d88dd0615a62ef98fe9726d77bb9cc2 (patch)
treebc8425828a87344fef3f74059e9c46079b9a5033
parent9070dc84504eb386164cf05c8eb7f72162dcba10 (diff)
parentbecf46bfdff50dab319210b69d30185f87db7f17 (diff)
Merge "Use EUI64 IPv6 link-local address generation only when randomizing MAC" into qt-dev
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index 12c45e90f..9cf1d6981 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -5300,12 +5300,17 @@ public class ClientModeImpl extends StateMachine {
final WifiConfiguration currentConfig = getCurrentWifiConfiguration();
final boolean isUsingStaticIp =
(currentConfig.getIpAssignment() == IpConfiguration.IpAssignment.STATIC);
+ final boolean isUsingMacRandomization =
+ currentConfig.macRandomizationSetting
+ == WifiConfiguration.RANDOMIZATION_PERSISTENT
+ && isConnectedMacRandomizationEnabled();
if (mVerboseLoggingEnabled) {
final String key = currentConfig.configKey();
log("enter ObtainingIpState netId=" + Integer.toString(mLastNetworkId)
+ " " + key + " "
+ " roam=" + mIsAutoRoaming
- + " static=" + isUsingStaticIp);
+ + " static=" + isUsingStaticIp
+ + " randomMac=" + isUsingMacRandomization);
}
// Send event to CM & network change broadcast
@@ -5334,26 +5339,26 @@ public class ClientModeImpl extends StateMachine {
mIpClient.setTcpBufferSizes(mTcpBufferSizes);
}
}
- final ProvisioningConfiguration prov;
+ final ProvisioningConfiguration.Builder prov;
if (!isUsingStaticIp) {
prov = new ProvisioningConfiguration.Builder()
.withPreDhcpAction()
.withApfCapabilities(mWifiNative.getApfCapabilities(mInterfaceName))
.withNetwork(getCurrentNetwork())
- .withDisplayName(currentConfig.SSID)
- .withRandomMacAddress()
- .build();
+ .withDisplayName(currentConfig.SSID);
+ if (isUsingMacRandomization) {
+ prov.withRandomMacAddress();
+ }
} else {
StaticIpConfiguration staticIpConfig = currentConfig.getStaticIpConfiguration();
prov = new ProvisioningConfiguration.Builder()
.withStaticConfiguration(staticIpConfig)
.withApfCapabilities(mWifiNative.getApfCapabilities(mInterfaceName))
.withNetwork(getCurrentNetwork())
- .withDisplayName(currentConfig.SSID)
- .build();
+ .withDisplayName(currentConfig.SSID);
}
if (mIpClient != null) {
- mIpClient.startProvisioning(prov);
+ mIpClient.startProvisioning(prov.build());
}
// Get Link layer stats so as we get fresh tx packet counters
getWifiLinkLayerStats();