]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Report link specific association failures from the kernel
authorBenjamin Berg <benjamin.berg@intel.com>
Mon, 20 Nov 2023 23:51:30 +0000 (01:51 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 25 Nov 2023 15:06:52 +0000 (17:06 +0200)
If a link specific error occured, mark the offending link within the
association parameters.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c

index d7f4c599dde01981c1708bf26af832ac1b345231..d6c490d1c859623505248d44057659e308485366 100644 (file)
@@ -949,6 +949,7 @@ struct wpa_driver_mld_params {
                const u8 *bssid;
                const u8 *ies;
                size_t ies_len;
+               int error;
        } mld_links[MAX_NUM_MLD_LINKS];
 };
 
index 2ff7b52bf5e9003f12c105eda2295dfdb4e14a5c..5a4dac7b613a7d2b1917ee7b043cc5c3bbffb763 100644 (file)
@@ -7260,6 +7260,7 @@ static int wpa_driver_nl80211_associate(
 {
        struct i802_bss *bss = priv;
        struct wpa_driver_nl80211_data *drv = bss->drv;
+       struct nl80211_err_info err_info;
        int ret = -1;
        struct nl_msg *msg;
 
@@ -7319,13 +7320,27 @@ static int wpa_driver_nl80211_associate(
        }
 
        ret = send_and_recv_msgs_connect_handle(drv, msg, drv->first_bss, 1,
-                                               NULL);
+                                               &err_info);
        msg = NULL;
        if (ret) {
                wpa_dbg(drv->ctx, MSG_DEBUG,
                        "nl80211: MLME command failed (assoc): ret=%d (%s)",
                        ret, strerror(-ret));
                nl80211_dump_scan(drv);
+
+               /* Mark failed link within params */
+               if (err_info.link_id >= 0) {
+                       if (err_info.link_id >= MAX_NUM_MLD_LINKS ||
+                           !(params->mld_params.valid_links &
+                             BIT(err_info.link_id))) {
+                               wpa_printf(MSG_DEBUG,
+                                          "nl80211: Invalid errorred link_id %d",
+                                          err_info.link_id);
+                               goto fail;
+                       }
+                       params->mld_params.mld_links[err_info.link_id].error =
+                               ret;
+               }
        } else {
                wpa_printf(MSG_DEBUG,
                           "nl80211: Association request send successfully");