Snap for 5694913 from 43b5a299f9d6cfb161342030cdca2ae37cf5e65f to qt-c2f2-release
Change-Id: I3a36adf425bc01088b934b5c7dfa3d1f8e70055d
diff --git a/wpa_supplicant/hidl/1.2/p2p_iface.cpp b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
index 7dddee9..ada7ee6 100644
--- a/wpa_supplicant/hidl/1.2/p2p_iface.cpp
+++ b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
@@ -1750,6 +1750,14 @@
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.",