Skip to content

Commit

Permalink
wifi: Set ADDR3 field of MPDU aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
stavallo authored and Stefano Avallone committed Jan 27, 2023
1 parent 84001f6 commit dbc4079
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/wifi/model/eht/eht-frame-exchange-manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,31 @@ EhtFrameExchangeManager::CreateAlias(Ptr<WifiMpdu> mpdu) const
}

mpdu = mpdu->CreateAlias(m_linkId);
mpdu->GetHeader().SetAddr2(GetAddress());
auto address =
GetWifiRemoteStationManager()->GetAffiliatedStaAddress(mpdu->GetHeader().GetAddr1());
auto& hdr = mpdu->GetHeader();
hdr.SetAddr2(GetAddress());
auto address = GetWifiRemoteStationManager()->GetAffiliatedStaAddress(hdr.GetAddr1());
NS_ASSERT(address);
mpdu->GetHeader().SetAddr1(*address);
hdr.SetAddr1(*address);
/*
* Set Address3 according to Table 9-30 of 802.11-2020 and Section 35.3.3 of
* 802.11be D2.0 ["the value of the Address 3 field and the Address 4 field (if present)
* in the MAC header of a data frame shall be set based on Table 9-30 (Address field
* contents) and the settings of the To DS and From DS bits, where the BSSID is the
* MAC address of the AP affiliated with the AP MLD corresponding to that link"].
*/
if (hdr.IsQosAmsdu())
{
if (hdr.IsToDs() && !hdr.IsFromDs())
{
// from STA to AP: BSSID is in Address1
hdr.SetAddr3(hdr.GetAddr1());
}
else if (!hdr.IsToDs() && hdr.IsFromDs())
{
// from AP to STA: BSSID is in Address2
hdr.SetAddr3(hdr.GetAddr2());
}
}

return mpdu;
}
Expand Down

0 comments on commit dbc4079

Please sign in to comment.