]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: correctly check if CSA is active
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 11 Jan 2026 17:19:30 +0000 (19:19 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 12 Jan 2026 18:36:18 +0000 (19:36 +0100)
We are not adding an interface if an existing one is doing CSA.
But the check won't work for MLO station interfaces, since for those,
vif->bss_conf is zeroed out.
Fix this by checking if any link of the vif has an active CSA.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260111191912.7ceff62fc561.Ia38d27f42684d1cfd82d930d232bd5dea6ab9282@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/iface.c

index 7b0aa24c1f97ca3567848502fbb44561d32ba1d2..515384ca2f8fba054aff4df8de8b0865055afbe5 100644 (file)
@@ -350,6 +350,8 @@ static int ieee80211_check_concurrent_iface(struct ieee80211_sub_if_data *sdata,
        /* we hold the RTNL here so can safely walk the list */
        list_for_each_entry(nsdata, &local->interfaces, list) {
                if (nsdata != sdata && ieee80211_sdata_running(nsdata)) {
+                       struct ieee80211_link_data *link;
+
                        /*
                         * Only OCB and monitor mode may coexist
                         */
@@ -376,8 +378,10 @@ static int ieee80211_check_concurrent_iface(struct ieee80211_sub_if_data *sdata,
                         * will not add another interface while any channel
                         * switch is active.
                         */
-                       if (nsdata->vif.bss_conf.csa_active)
-                               return -EBUSY;
+                       for_each_link_data(nsdata, link) {
+                               if (link->conf->csa_active)
+                                       return -EBUSY;
+                       }
 
                        /*
                         * The remaining checks are only performed for interfaces