diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 8222d6fee..542718365 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -359,9 +359,7 @@ QosTxop::DequeuePeekedFrame (Ptr peekedItem, WifiTxVecto } } - // the packet has been peeked from the EDCA queue. - uint16_t sequence = m_txMiddle->GetNextSequenceNumberFor (&peekedItem->GetHeader ()); - + // The packet has been peeked from the EDCA queue. // If it is a QoS Data frame and it is not a broadcast frame, attempt A-MSDU // aggregation if aggregate is true if (peekedItem->GetHeader ().IsQosData ()) @@ -371,6 +369,8 @@ QosTxop::DequeuePeekedFrame (Ptr peekedItem, WifiTxVecto NS_ASSERT (testIt != m_queue->end () && (*testIt)->GetPacket () == peekedItem->GetPacket ()); + uint16_t sequence = m_txMiddle->PeekNextSequenceNumberFor (&peekedItem->GetHeader ()); + // check if the peeked packet is within the transmit window if (GetBaAgreementEstablished (recipient, tid) && !IsInWindow (sequence, GetBaStartingSequence (recipient, tid), GetBaBufferSize (recipient, tid))) @@ -402,8 +402,10 @@ QosTxop::DequeuePeekedFrame (Ptr peekedItem, WifiTxVecto NS_ASSERT (item != 0 && item->GetPacket () == peekedItem->GetPacket ()); } - // Assign a sequence number to the MSDU or A-MSDU dequeued from the EDCA queue NS_ASSERT (item != 0); + + // Assign a sequence number to the MSDU or A-MSDU dequeued from the EDCA queue + uint16_t sequence = m_txMiddle->GetNextSequenceNumberFor (&item->GetHeader ()); item->GetHeader ().SetSequenceNumber (sequence); item->GetHeader ().SetFragmentNumber (0); item->GetHeader ().SetNoMoreFragments ();