From 815942a5cccdb54dd923884a2a8aac217f3c8e15 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 15 Mar 2022 16:57:26 +0100 Subject: [PATCH] wifi: Ensure ADDBA Request frame is queued --- src/wifi/model/ht/ht-frame-exchange-manager.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index 6e4c38cdf..ccbecd160 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -185,7 +185,12 @@ HtFrameExchangeManager::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16 txParams.m_acknowledgment = GetAckManager ()->TryAddMpdu (mpdu, txParams); // Push the MPDU to the front of the queue and transmit it - m_mac->GetQosTxop (tid)->GetWifiMacQueue ()->PushFront (mpdu); + auto queue = m_mac->GetQosTxop (tid)->GetWifiMacQueue (); + if (!queue->PushFront (mpdu)) + { + NS_LOG_DEBUG ("Queue is full, replace the oldest frame with the ADDBA Request frame"); + queue->Replace (queue->Peek (), mpdu); + } SendMpduWithProtection (mpdu, txParams); }