wifi: (fixes #2313) remove A-MPDU subframe header before peeking WifiMacHeader in MacLow::ReceiveError

This commit is contained in:
Sébastien Deronne
2016-03-01 20:06:44 +01:00
parent 44355247f4
commit 210ae29049
5 changed files with 9 additions and 8 deletions

View File

@@ -533,7 +533,7 @@ void
MacLow::ResetPhy (void)
{
m_phy->SetReceiveOkCallback (MakeNullCallback<void, Ptr<Packet>, double, WifiTxVector, enum WifiPreamble> ());
m_phy->SetReceiveErrorCallback (MakeNullCallback<void, Ptr<const Packet>, double, bool> ());
m_phy->SetReceiveErrorCallback (MakeNullCallback<void, Ptr<Packet>, double, bool> ());
RemovePhyMacLowListener (m_phy);
m_phy = 0;
}
@@ -837,14 +837,15 @@ MacLow::NeedCtsToSelf (void)
}
void
MacLow::ReceiveError (Ptr<const Packet> packet, double rxSnr, bool isEndOfFrame)
MacLow::ReceiveError (Ptr<Packet> packet, double rxSnr, bool isEndOfFrame)
{
NS_LOG_FUNCTION (this << packet << rxSnr << isEndOfFrame);
NS_LOG_DEBUG ("rx failed ");
if (isEndOfFrame == true && m_receivedAtLeastOneMpdu == true)
{
WifiMacHeader hdr;
packet->PeekHeader (hdr);
MpduAggregator::DeaggregatedMpdus mpdu = MpduAggregator::Deaggregate (packet);
mpdu.begin ()->first->PeekHeader (hdr);
if (hdr.GetAddr1 () != m_self)
{
NS_LOG_DEBUG ("hdr addr1 " << hdr.GetAddr1 () << "not for me (" << m_self << "); returning");
@@ -1684,7 +1685,7 @@ MacLow::ForwardDown (Ptr<const Packet> packet, const WifiMacHeader* hdr,
ampdutag.SetNoOfMpdus (queueSize);
newPacket->AddPacketTag (ampdutag);
if (delay == Seconds (0))
{
if (!vhtSingleMpdu)

View File

@@ -732,7 +732,7 @@ public:
* This method is typically invoked by the lower PHY layer to notify
* the MAC layer that a packet was unsuccessfully received.
*/
void ReceiveError (Ptr<const Packet> packet, double rxSnr, bool isEndOfFrame);
void ReceiveError (Ptr<Packet> packet, double rxSnr, bool isEndOfFrame);
/**
* \param duration switching delay duration.
*

View File

@@ -442,7 +442,7 @@ WifiPhyStateHelper::SwitchFromRxEndOk (Ptr<Packet> packet, double snr, WifiTxVec
}
void
WifiPhyStateHelper::SwitchFromRxEndError (Ptr<const Packet> packet, double snr, bool isEndOfFrame)
WifiPhyStateHelper::SwitchFromRxEndError (Ptr<Packet> packet, double snr, bool isEndOfFrame)
{
m_rxErrorTrace (packet, snr);
NotifyRxEndError ();

View File

@@ -169,7 +169,7 @@ public:
* \param snr the SNR of the received packet
* \param isEndOfFrame PHY-RXEND indication.
*/
void SwitchFromRxEndError (Ptr<const Packet> packet, double snr, bool isEndOfFrame);
void SwitchFromRxEndError (Ptr<Packet> packet, double snr, bool isEndOfFrame);
/**
* Switch to CCA busy.
*

View File

@@ -194,7 +194,7 @@ public:
* arg2: snr of packet
* arg3: PHY-RXEND flag
*/
typedef Callback<void, Ptr<const Packet>, double, bool> RxErrorCallback;
typedef Callback<void, Ptr<Packet>, double, bool> RxErrorCallback;
static TypeId GetTypeId (void);