]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: report assoc_link_id in station info for non-MLD STAs on MLD AP
authorFelix Fietkau <nbd@nbd.name>
Thu, 28 May 2026 10:50:42 +0000 (10:50 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jun 2026 12:07:05 +0000 (14:07 +0200)
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>
Link: https://patch.msgid.link/20260528105042.835284-1-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/sta_info.c

index 0ea37016cd4f778364242ac62d6086f9a33b24d6..4c86a3793804f7a98da4479f4e2264202a846522 100644 (file)
@@ -3258,7 +3258,10 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
                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;