Skip to contentSkip to conversation

wifi: mac80211: fix CSA/CCA regression

PATCH New Aloka Dixit 1 participant 3 messages Oct 2 mac80211

lore
Share & tools
lore
#0 lore raw

cover wifi: mac80211: fix CSA/CCA regression

First patch reverts an old commit with detailed description. Second patch removes a minor redundant check.

---
Aloka Dixit (2):
Revert "wifi: mac80211: do not use old MBSSID elements"
wifi: mac80211: remove redundant null check in ieee80211_assign_beacon()

 net/mac80211/cfg.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

---
base-commit: f49defea7668d8c68ec19fa085ef3da6075561c7
change-id: 20261002-csa_cca_fix-ec333d7100e0

Best regards,

Signature · 1 line
Aloka Dixit <[email protected]>
#1 lore raw

PATCH 1/2 Revert "wifi: mac80211: do not use old MBSSID elements"

Commit a519be2f5d95 ("wifi: mac80211: do not use old MBSSID elements") fixed the incorrect inclusion of stopped/removed non-transmitted profiles from the Beacon frames, but it caused a regression for channel switch (CSA) and BSS color change (CCA) operations initiated from hostapd.

Hostapd passes two Beacon templates to kernel for CSA and CCA -
(1) beacon_csa/beacon_color_change used during the countdown.
(2) beacon_after/beacon_next used after the countdown completes. Hostapd relies on the kernel to include the old MBSSID elements while sending beacon_csa/beacon_color_change templates to the driver.

This path is now broken and results in CSA/CCA failure.

Including existing MBSSID elements explicitly makes the netlink buffer larger than default 4 KB depending on the number of APs which would need unnecessary complication to pre-calculate the buffer length.

Revert the commit to fix the regression.

Regarding the original issue fixed by the reverted commit - Hostapd now has a new commit which always includes at least one MBSSID element when the feature is enabled, hence when all non-transmitted profiles are removed, this empty element ensures that stopped profiles are not advertised.

Fixes a519be2f5d95 ("wifi: mac80211: do not use old MBSSID elements")
---
 net/mac80211/cfg.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
net/mac80211/cfg.c +10 -0
index bd1a857c812d..b38941e6784f 100644
@@ -1518,6 +1518,7 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
 
 	size = sizeof(*new) + new_head_len + new_tail_len;
 
+	/* new or old multiple BSSID elements? */
 	if (params->mbssid_ies) {
 		mbssid = params->mbssid_ies;
 		size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
@@ -1527,6 +1528,15 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
 		}
 		size += ieee80211_get_mbssid_beacon_len(mbssid, rnr,
 							mbssid->cnt);
+	} else if (old && old->mbssid_ies) {
+		mbssid = old->mbssid_ies;
+		size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
+		if (old && old->rnr_ies) {
+			rnr = old->rnr_ies;
+			size += struct_size(new->rnr_ies, elem, rnr->cnt);
+		}
+		size += ieee80211_get_mbssid_beacon_len(mbssid, rnr,
+							mbssid->cnt);
 	}
 
 	new = kzalloc(size, GFP_KERNEL);
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 wifi: mac80211: remove redundant null check in ieee80211_assign_beacon()

In reply to Aloka Dixit

The else-if branch condition 'old && old->mbssid_ies' already guarantees 'old' is non-NULL. The inner 'old &&' in 'if (old && old->rnr_ies)' is therefore redundant; remove it.

---
 net/mac80211/cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/cfg.c +1 -1
index b38941e6784f..cd5781ba2873 100644
@@ -1531,7 +1531,7 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
 	} else if (old && old->mbssid_ies) {
 		mbssid = old->mbssid_ies;
 		size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
-		if (old && old->rnr_ies) {
+		if (old->rnr_ies) {
 			rnr = old->rnr_ies;
 			size += struct_size(new->rnr_ies, elem, rnr->cnt);
 		}
Signature · 1 line
2.34.1