]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:38:39 +0000 (16:38 +0200)
[ Upstream commit 2eb7c1baf46aea134e908cd6d37907d92f823251 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/cfg.c

index 954795b0fe48a88d4d34b41bd81398de7838f1e9..bc64c1b83a6e6b94a7ffdfe52fca5f6110d33bf6 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) {