]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Add Target BSSID into BSS Transition Management Response
authorJouni Malinen <j@w1.fi>
Fri, 27 Dec 2013 16:05:27 +0000 (18:05 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 27 Dec 2013 16:11:07 +0000 (18:11 +0200)
P802.11-REVmc clarifies that the Target BSSID field is always present
hen status code is zero, so match that requirement.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/wnm_sta.c

index 540b1389ac32090dd32b61fda182b7010e636d74..1c6c715df8ba673aed41a744ba3e9dff71dc1682 100644 (file)
@@ -533,6 +533,14 @@ static void wnm_send_bss_transition_mgmt_resp(
        if (target_bssid) {
                os_memcpy(pos, target_bssid, ETH_ALEN);
                pos += ETH_ALEN;
+       } else if (status == WNM_BSS_TM_ACCEPT) {
+               /*
+                * P802.11-REVmc clarifies that the Target BSSID field is always
+                * present when status code is zero, so use a fake value here if
+                * no BSSID is yet known.
+                */
+               os_memset(pos, 0, ETH_ALEN);
+               pos += ETH_ALEN;
        }
 
        len = pos - (u8 *) &mgmt->u.action.category;
@@ -574,7 +582,7 @@ void wnm_scan_response(struct wpa_supplicant *wpa_s,
                        wnm_send_bss_transition_mgmt_resp(wpa_s,
                                                  wpa_s->wnm_dialog_token,
                                                  WNM_BSS_TM_ACCEPT,
-                                                 0, NULL);
+                                                 0, bssid);
                }
 
                wpa_s->reassociate = 1;