Commit 2e85829a authored by Johannes Berg's avatar Johannes Berg
Browse files

wifi: nl80211: fix assoc link handling



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: 720fa448 ("wifi: nl80211: Split the links handling of an association request")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Reviewed-by: default avatarIlan Peer <ilan.peer@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250306123626.7b233d769c32.I62fd04a8667dd55cedb9a1c0414cc92dd098da75@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 20d5a0b9
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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)
{
@@ -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;
@@ -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;
@@ -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;