From 96fdc81c68492c09488f145367c53202195563c0 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 6 Oct 2021 17:16:08 +0200 Subject: [PATCH] wifi: Mark an MPDU as acknowledged before removing it from the in-flight queue This avoids a crash in the event that an MPDU sent in an S-MPDU under a Block Ack agreement is acknowledged after its lifetime expired. --- src/wifi/model/block-ack-manager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index f74103f39..0bd097c71 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -444,6 +444,8 @@ BlockAckManager::NotifyGotAck (Ptr mpdu) AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); NS_ASSERT (it != m_agreements.end ()); + it->second.first.NotifyAckedMpdu (mpdu); + // remove the acknowledged frame from the queue of outstanding packets for (auto queueIt = it->second.second.begin (); queueIt != it->second.second.end (); ++queueIt) { @@ -453,8 +455,6 @@ BlockAckManager::NotifyGotAck (Ptr mpdu) break; } } - - it->second.first.NotifyAckedMpdu (mpdu); } void