]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: Fix bssid_indicator for MBSSID in AP mode
authorRameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Fri, 30 May 2025 04:09:40 +0000 (09:39 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 20 Jun 2025 08:45:19 +0000 (10:45 +0200)
Currently, in ieee80211_assign_beacon() mbssid count is updated as link's
bssid_indicator. mbssid count is the total number of MBSSID elements in
the beacon instead of Max BSSID indicator of the Multiple BSS set.
This will result in drivers obtaining an invalid bssid_indicator for BSSes
in a Multiple BSS set.
Fix this by updating link's bssid_indicator from MBSSID element for
Transmitting BSS and update the same for all of its Non-Transmitting BSSes.

Fixes: dde78aa52015 ("mac80211: update bssid_indicator in ieee80211_assign_beacon")
Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20250530040940.3188537-1-rameshkumar.sundaram@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c

index 55a8fbd255148b3a40d9239f5bfd4c7e6619c0c7..e0dd0a8625c0151a6d5ebdf4e37f4e3bc257b340 100644 (file)
@@ -178,6 +178,7 @@ static int ieee80211_set_ap_mbssid_options(struct ieee80211_sub_if_data *sdata,
 
                link_conf->nontransmitted = true;
                link_conf->bssid_index = params->index;
+               link_conf->bssid_indicator = tx_bss_conf->bssid_indicator;
        }
        if (params->ema)
                link_conf->ema_ap = true;
@@ -1218,8 +1219,11 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
                        ieee80211_copy_rnr_beacon(pos, new->rnr_ies, rnr);
                }
                /* update bssid_indicator */
-               link_conf->bssid_indicator =
-                       ilog2(__roundup_pow_of_two(mbssid->cnt + 1));
+               if (new->mbssid_ies->cnt && new->mbssid_ies->elem[0].len > 2)
+                       link_conf->bssid_indicator =
+                                       *(new->mbssid_ies->elem[0].data + 2);
+               else
+                       link_conf->bssid_indicator = 0;
        }
 
        if (csa) {