Update wpa_supplicant MAC address before connecting
Call wpa_supplicant_update_mac_addr() before every connection to make
sure that the supplicant is using the latest MAC address, which could
have changed due to Connected MAC Randomization.
Bug: 77861722
Test: Manual Check
Change-Id: I3797a120b120e765342f96d1f5d551f153ccedc9
diff --git a/wpa_supplicant/hidl/1.1/sta_network.cpp b/wpa_supplicant/hidl/1.1/sta_network.cpp
index e50927f..9d4cc91 100644
--- a/wpa_supplicant/hidl/1.1/sta_network.cpp
+++ b/wpa_supplicant/hidl/1.1/sta_network.cpp
@@ -1528,6 +1528,9 @@
struct wpa_supplicant *wpa_s = retrieveIfacePtr();
wpa_s->scan_min_time.sec = 0;
wpa_s->scan_min_time.usec = 0;
+ // Make sure that the supplicant is updated to the latest
+ // MAC address, which might have changed due to MAC randomization.
+ wpa_supplicant_update_mac_addr(wpa_s);
wpa_supplicant_select_network(wpa_s, wpa_ssid);
return {SupplicantStatusCode::SUCCESS, ""};
}