diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index f6319558c..50f6c259a 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -432,13 +432,16 @@ BlockAckManager::RemovePacket (uint8_t tid, Mac48Address recipient, uint16_t seq } bool -BlockAckManager::HasBar (Bar &bar) +BlockAckManager::HasBar (Bar &bar, bool remove) { CleanupBuffers (); if (m_bars.size () > 0) { bar = m_bars.front (); - m_bars.pop_front (); + if (remove) + { + m_bars.pop_front (); + } return true; } return false; diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index c6d854cc8..ff6dcd432 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -166,10 +166,11 @@ public: * Returns true if the BAR is scheduled. Returns false otherwise. * * \param bar + * \param remove true if the BAR has to be removed from the queue * * \return true if a BAR is scheduled, false otherwise */ - bool HasBar (Bar &bar); + bool HasBar (Bar &bar, bool remove = true); /** * Returns true if there are packets that need of retransmission or at least a * BAR is scheduled. Returns false otherwise.