Skip to content

Commit

Permalink
wifi: mac80211: fix RX MLD address translation
Browse files Browse the repository at this point in the history
We should only translate addr3 here if it's the BSSID.

Fixes: 42fb914 ("wifi: mac80211: do link->MLD address translation on RX")
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
jmberg-intel committed Jul 22, 2022
1 parent 206c8c0 commit 1f63894
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4776,10 +4776,14 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
ether_addr_copy(hdr->addr1, rx->sdata->vif.addr);
if (ether_addr_equal(link_sta->addr, hdr->addr2))
ether_addr_copy(hdr->addr2, rx->sta->addr);
if (ether_addr_equal(link_sta->addr, hdr->addr3))
ether_addr_copy(hdr->addr3, rx->sta->addr);
else if (ether_addr_equal(link->conf->addr, hdr->addr3))
ether_addr_copy(hdr->addr3, rx->sdata->vif.addr);
/* translate A3 only if it's the BSSID */
if (!ieee80211_has_tods(hdr->frame_control) &&
!ieee80211_has_fromds(hdr->frame_control)) {
if (ether_addr_equal(link_sta->addr, hdr->addr3))
ether_addr_copy(hdr->addr3, rx->sta->addr);
else if (ether_addr_equal(link->conf->addr, hdr->addr3))
ether_addr_copy(hdr->addr3, rx->sdata->vif.addr);
}
/* not needed for A4 since it can only carry the SA */
}

Expand Down

0 comments on commit 1f63894

Please sign in to comment.