2023-09-20 21:03:47

by Greenman, Gregory

[permalink] [raw]
Subject: [PATCH v2 17/18] wifi: mac80211: report per-link error during association

From: Benjamin Berg <[email protected]>

With this cfg80211 can report the link that caused the error to
userspace which is then able to react to it by e.g. removing the link
from the association and retrying.

Signed-off-by: Benjamin Berg <[email protected]>
Signed-off-by: Gregory Greenman <[email protected]>
---
net/mac80211/mlme.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index c1619bb2b11d..a10b9420aa68 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -7889,8 +7889,10 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
/* only calculate the flags, hence link == NULL */
err = ieee80211_prep_channel(sdata, NULL, assoc_data->link[i].bss,
&assoc_data->link[i].conn_flags);
- if (err)
+ if (err) {
+ req->links[i].error = err;
goto err_clear;
+ }
}

/* needed for transmitting the assoc frames properly */
--
2.38.1