aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Chen <jimmycmchen@google.com>2019-06-19 18:50:44 +0800
committerJimmy Chen <jimmycmchen@google.com>2019-06-26 14:57:54 +0800
commitcf890b898db562756455f405552ee85eff899041 (patch)
tree4f96ec98717657b9c1982cbf9a185e3a0239b371
parent811b01bb75c67c51e1c0a34a94ded69858043dcd (diff)
downloadwpa_supplicant_8-cf890b898db562756455f405552ee85eff899041.tar.gz
p2p: return FAILURE_ARGS_INVALID if MAC randomization is not supportedandroid10-dev
Bug: 135247522 Test: atest VtsHalWifiSupplicantP2pV1_2TargetTest Change-Id: I7b2875a2eab33c85859f80774c7946011ce5c947
-rw-r--r--wpa_supplicant/hidl/1.2/p2p_iface.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/wpa_supplicant/hidl/1.2/p2p_iface.cpp b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
index 7dddee95..ada7ee6e 100644
--- a/wpa_supplicant/hidl/1.2/p2p_iface.cpp
+++ b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
@@ -1750,6 +1750,14 @@ SupplicantStatus P2pIface::setMacRandomizationInternal(bool enable)
bool currentEnabledState = !!wpa_s->conf->p2p_device_random_mac_addr;
u8 *addr = NULL;
+ // A dedicated p2p device is not managed by supplicant,
+ // supplicant could not change its MAC address.
+ if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE) {
+ wpa_printf(MSG_ERROR,
+ "Dedicated P2P device don't support MAC randomization");
+ return {SupplicantStatusCode::FAILURE_ARGS_INVALID, "NotSupported"};
+ }
+
// The same state, no change is needed.
if (currentEnabledState == enable) {
wpa_printf(MSG_DEBUG, "The random MAC is %s already.",