]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix send_mlme for SAE external auth
authorOuden <Ouden.Biz@gmail.com>
Thu, 30 Jan 2020 09:08:14 +0000 (17:08 +0800)
committerJouni Malinen <jouni@codeaurora.org>
Sun, 2 Feb 2020 19:38:51 +0000 (21:38 +0200)
When external authentication is used, the station send mlme frame (auth)
to the driver may not be able to get the frequency (bss->freq) after
hostap.git commit b6f8b5a9 ("nl80211: Update freq only when CSA
completes"). Use the assoc_freq to send the MLME frame when SAE external
authentication is used to avoid this issue.

Signed-off-by: Ouden <Ouden.Biz@gmail.com>
src/drivers/driver_nl80211.c

index 64bea49e173308afca1d69f715de479cc98d5aeb..7305ed60b39ef6e57dfc6a4bd9612431c5aa55d0 100644 (file)
@@ -3747,6 +3747,17 @@ static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data,
                        encrypt = 0;
        }
 
+       if (freq == 0 && drv->nlmode == NL80211_IFTYPE_STATION &&
+           (drv->capa.flags & WPA_DRIVER_FLAGS_SAE) &&
+           !(drv->capa.flags & WPA_DRIVER_FLAGS_SME) &&
+           WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
+           WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
+               freq = nl80211_get_assoc_freq(drv);
+               wpa_printf(MSG_DEBUG,
+                          "nl80211: send_mlme - Use assoc_freq=%u for external auth",
+                          freq);
+       }
+
        if (freq == 0 && drv->nlmode == NL80211_IFTYPE_ADHOC) {
                freq = nl80211_get_assoc_freq(drv);
                wpa_printf(MSG_DEBUG,