]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Update assoc_freq and bss->freq based on real association info
authorJouni Malinen <j@w1.fi>
Sun, 14 Apr 2019 09:37:41 +0000 (12:37 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 14 Apr 2019 09:40:45 +0000 (12:40 +0300)
Move event.assoc_info.freq selection to be after the
nl80211_get_assoc_ssid() call so that the current cfg80211 information
on the operating channel can be used should anything unexpected have
happened between the association request and completion of association.
Furthermore, update bss->freq based on assoc_freq to make that
information a bit more useful for station mode. It was already updated
after channel switches during association, but not at the beginning of
association.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver_nl80211_event.c

index 4db79e7117797964ab28214d4fa73d12a585cf00..fdd276144e551ed3cc1ce4d26ea25e3d03495959 100644 (file)
@@ -267,8 +267,6 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
                event.assoc_info.req_ies_len = nla_len(req_ie);
        }
 
-       event.assoc_info.freq = drv->assoc_freq;
-
        /* When this association was initiated outside of wpa_supplicant,
         * drv->ssid needs to be set here to satisfy later checking. */
        ssid_len = nl80211_get_assoc_ssid(drv, drv->ssid);
@@ -279,6 +277,9 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
                           wpa_ssid_txt(drv->ssid, drv->ssid_len));
        }
 
+       event.assoc_info.freq = drv->assoc_freq;
+       drv->first_bss->freq = drv->assoc_freq;
+
        nl80211_parse_wmm_params(wmm, &event.assoc_info.wmm_params);
 
        wpa_supplicant_event(drv->ctx, EVENT_ASSOC, &event);
@@ -408,6 +409,7 @@ static void mlme_event_connect(struct wpa_driver_nl80211_data *drv,
        }
 
        event.assoc_info.freq = nl80211_get_assoc_freq(drv);
+       drv->first_bss->freq = drv->assoc_freq;
 
        if ((!ssid || ssid[1] == 0 || ssid[1] > 32) &&
            (ssid_len = nl80211_get_assoc_ssid(drv, drv->ssid)) > 0) {