]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
GAS: Update source MAC address on preassoc_mac_addr randomization
authorVeerendranath Jakkam <vjakkam@codeaurora.org>
Mon, 10 Aug 2020 20:01:49 +0000 (01:31 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 13 Aug 2020 14:34:43 +0000 (17:34 +0300)
The GAS query source MAC address was not getting updated correctly when
preassoc_mac_addr is enabled. Fix this by copying the current MAC
address to the GAS query source address.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
wpa_supplicant/gas_query.c

index 9416921110913710b8132027a3b749c5cf758680..e60a8c1fe6aaa92ada19a4078320d44a2bec55ba 100644 (file)
@@ -694,13 +694,15 @@ static void gas_query_start_cb(struct wpa_radio_work *work, int deinit)
                return;
        }
 
-       if (!query->maintain_addr && !wpa_s->conf->gas_rand_mac_addr &&
-           wpas_update_random_addr_disassoc(wpa_s) < 0) {
-               wpa_msg(wpa_s, MSG_INFO,
-                       "Failed to assign random MAC address for GAS");
-               gas_query_free(query, 1);
-               radio_work_done(work);
-               return;
+       if (!query->maintain_addr && !wpa_s->conf->gas_rand_mac_addr) {
+               if (wpas_update_random_addr_disassoc(wpa_s) < 0) {
+                       wpa_msg(wpa_s, MSG_INFO,
+                               "Failed to assign random MAC address for GAS");
+                       gas_query_free(query, 1);
+                       radio_work_done(work);
+                       return;
+               }
+               os_memcpy(query->sa, wpa_s->own_addr, ETH_ALEN);
        }
 
        gas->work = work;