Skip to content

Commit 2e85829

Browse files
committed
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: 720fa44 ("wifi: nl80211: Split the links handling of an association request") Signed-off-by: Johannes Berg <[email protected]> Reviewed-by: Ilan Peer <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250306123626.7b233d769c32.I62fd04a8667dd55cedb9a1c0414cc92dd098da75@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 20d5a0b commit 2e85829

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

net/wireless/nl80211.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11123,6 +11123,7 @@ static struct cfg80211_bss *nl80211_assoc_bss(struct cfg80211_registered_device
1112311123

1112411124
static int nl80211_process_links(struct cfg80211_registered_device *rdev,
1112511125
struct cfg80211_assoc_link *links,
11126+
int assoc_link_id,
1112611127
const u8 *ssid, int ssid_len,
1112711128
struct genl_info *info)
1112811129
{
@@ -11153,7 +11154,7 @@ static int nl80211_process_links(struct cfg80211_registered_device *rdev,
1115311154
}
1115411155
links[link_id].bss =
1115511156
nl80211_assoc_bss(rdev, ssid, ssid_len, attrs,
11156-
link_id, link_id);
11157+
assoc_link_id, link_id);
1115711158
if (IS_ERR(links[link_id].bss)) {
1115811159
err = PTR_ERR(links[link_id].bss);
1115911160
links[link_id].bss = NULL;
@@ -11350,8 +11351,8 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
1135011351
req.ap_mld_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]);
1135111352
ap_addr = req.ap_mld_addr;
1135211353

11353-
err = nl80211_process_links(rdev, req.links, ssid, ssid_len,
11354-
info);
11354+
err = nl80211_process_links(rdev, req.links, req.link_id,
11355+
ssid, ssid_len, info);
1135511356
if (err)
1135611357
goto free;
1135711358

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

1650716508
add_links = 0;
1650816509
if (info->attrs[NL80211_ATTR_MLO_LINKS]) {
16509-
err = nl80211_process_links(rdev, links, NULL, 0, info);
16510+
err = nl80211_process_links(rdev, links,
16511+
/* mark as MLO, but not assoc */
16512+
IEEE80211_MLD_MAX_NUM_LINKS,
16513+
NULL, 0, info);
1651016514
if (err)
1651116515
return err;
1651216516

0 commit comments

Comments
 (0)