]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mac80211: fix reporting MLO link ID for non-MLO STAs on MLO AP
authorFelix Fietkau <nbd@nbd.name>
Thu, 19 Mar 2026 04:48:28 +0000 (04:48 +0000)
committerFelix Fietkau <nbd@nbd.name>
Thu, 19 Mar 2026 09:57:26 +0000 (10:57 +0100)
Add missing information on station dump/get

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/kernel/mac80211/patches/subsys/380-mac80211-report-assoc_link_id-in-station-info-for-no.patch [new file with mode: 0644]

diff --git a/package/kernel/mac80211/patches/subsys/380-mac80211-report-assoc_link_id-in-station-info-for-no.patch b/package/kernel/mac80211/patches/subsys/380-mac80211-report-assoc_link_id-in-station-info-for-no.patch
new file mode 100644 (file)
index 0000000..44929d2
--- /dev/null
@@ -0,0 +1,33 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Wed, 18 Mar 2026 20:01:16 +0000
+Subject: [PATCH] mac80211: report assoc_link_id in station info for non-MLD
+ STAs on MLD AP
+
+When a non-MLD station associates with an MLD AP, it does so on a
+specific link. However, sta_set_sinfo() never sets mlo_params_valid,
+so nl80211 never emits NL80211_ATTR_MLO_LINK_ID in get_station /
+dump_station responses. Userspace has no way to determine which link
+a non-MLD STA is associated on.
+
+Set mlo_params_valid to 1 and assoc_link_id to sta->deflink.link_id,
+when valid_links is set.
+Also set the mld_addr copy only for MLD STAs, so that non-MLD STAs
+get a zeroed mld_addr as documented.
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -3252,7 +3252,10 @@ void sta_set_sinfo(struct sta_info *sta,
+               struct link_sta_info *link_sta;
+               int link_id;
+-              ether_addr_copy(sinfo->mld_addr, sta->addr);
++              sinfo->mlo_params_valid = true;
++              sinfo->assoc_link_id = sta->deflink.link_id;
++              if (sta->sta.mlo)
++                      ether_addr_copy(sinfo->mld_addr, sta->addr);
+               /* assign valid links first for iteration */
+               sinfo->valid_links = sta->sta.valid_links;