For broadcast frames, every interface might have to process it and therefore the link_id cannot be determined in the driver. When the frame is about to be forwarded to each interface, we can use the member "band" in struct ieee80211_rx_status to determine the "link_id" for each interface. Signed-off-by: Michael-CY Lee <michael-cy.lee@xxxxxxxxxxxx> Reviewed-by: Money Wang <money.wang@xxxxxxxxxxxx> --- net/mac80211/rx.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 09beb65d6108..7671fd39a60e 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -5115,8 +5115,28 @@ static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx, struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); sta = sta_info_get_bss(rx->sdata, hdr->addr2); - if (status->link_valid) + if (status->link_valid) { link_id = status->link_id; + } else if (ieee80211_vif_is_mld(&rx->sdata->vif)) { + struct ieee80211_supported_band *sband; + struct ieee80211_link_data *link; + int i; + + for_each_valid_link(&rx->sdata->wdev, i) { + link = rcu_dereference(rx->sdata->link[i]); + if (!link) + continue; + + sband = ieee80211_get_link_sband(link); + if (!sband) + continue; + + if (status->band == sband->band) { + link_id = i; + break; + } + } + } } if (!ieee80211_rx_data_set_sta(rx, sta, link_id)) -- 2.25.1