Skip to content

Commit

Permalink
wifi: nl80211: fix assoc link handling
Browse files Browse the repository at this point in the history
The refactoring of the assoc link handling in order to
support multi-link reconfiguration broke the setting
of the assoc link ID, and thus resulted in the wrong
BSS "use_for" value being selected. Fix that for both
association and ML reconfiguration.

Fixes: 720fa44 ("wifi: nl80211: Split the links handling of an association request")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250306123626.7b233d769c32.I62fd04a8667dd55cedb9a1c0414cc92dd098da75@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Mar 7, 2025
1 parent 20d5a0b commit 2e85829
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -11123,6 +11123,7 @@ static struct cfg80211_bss *nl80211_assoc_bss(struct cfg80211_registered_device

static int nl80211_process_links(struct cfg80211_registered_device *rdev,
struct cfg80211_assoc_link *links,
int assoc_link_id,
const u8 *ssid, int ssid_len,
struct genl_info *info)
{
Expand Down Expand Up @@ -11153,7 +11154,7 @@ static int nl80211_process_links(struct cfg80211_registered_device *rdev,
}
links[link_id].bss =
nl80211_assoc_bss(rdev, ssid, ssid_len, attrs,
link_id, link_id);
assoc_link_id, link_id);
if (IS_ERR(links[link_id].bss)) {
err = PTR_ERR(links[link_id].bss);
links[link_id].bss = NULL;
Expand Down Expand Up @@ -11350,8 +11351,8 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
req.ap_mld_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]);
ap_addr = req.ap_mld_addr;

err = nl80211_process_links(rdev, req.links, ssid, ssid_len,
info);
err = nl80211_process_links(rdev, req.links, req.link_id,
ssid, ssid_len, info);
if (err)
goto free;

Expand Down Expand Up @@ -16506,7 +16507,10 @@ static int nl80211_assoc_ml_reconf(struct sk_buff *skb, struct genl_info *info)

add_links = 0;
if (info->attrs[NL80211_ATTR_MLO_LINKS]) {
err = nl80211_process_links(rdev, links, NULL, 0, info);
err = nl80211_process_links(rdev, links,
/* mark as MLO, but not assoc */
IEEE80211_MLD_MAX_NUM_LINKS,
NULL, 0, info);
if (err)
return err;

Expand Down

0 comments on commit 2e85829

Please sign in to comment.