]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Restore permanent MAC address on reassociation
authorBenjamin Richter <br@waldteufel.eu>
Tue, 11 Oct 2016 03:57:38 +0000 (05:57 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 16 Oct 2016 08:44:34 +0000 (11:44 +0300)
With mac_addr=0 and preassoc_mac_addr=1, the permanent MAC address
should be restored for association. Previously this did not happen when
reassociating to the same ESS.

Signed-off-by: Benjamin Richter <br@waldteufel.eu>
wpa_supplicant/wpa_supplicant.c

index 247943245f0c47cf36adcaa8264c43bd0ac5e9cd..d9e28515d3a526ae61a55523997eeb234bf0abe3 100644 (file)
@@ -1691,11 +1691,13 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                        wmm_ac_save_tspecs(wpa_s);
                        wpa_s->reassoc_same_bss = 1;
                }
-       } else if (rand_style > 0) {
+       }
+
+       if (rand_style > 0 && !wpa_s->reassoc_same_ess) {
                if (wpas_update_random_addr(wpa_s, rand_style) < 0)
                        return;
                wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
-       } else if (wpa_s->mac_addr_changed) {
+       } else if (rand_style == 0 && wpa_s->mac_addr_changed) {
                if (wpa_drv_set_mac_addr(wpa_s, NULL) < 0) {
                        wpa_msg(wpa_s, MSG_INFO,
                                "Could not restore permanent MAC address");