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 */
}