diff --git a/RELEASE_NOTES b/RELEASE_NOTES index cfc8ce4e4..c492fc9b3 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -67,6 +67,7 @@ Bugs fixed - Bug 2414 - UdpSocket doesn't call NotifyConnectionFailed - Bug 2419 - BsmApplication should use RecvFrom and not SocketAddressTag - Bug 2420 - Remove code duplication between Wifi and Wave modules +- Bug 2421 - Negative RemainingAmpduDuration for the last MPDU in A-MPDU tag - Bug 2425 - UdpSocketImpl simplification - Bug 2427 - 802.11ac selects wrong slot duration - Bug 2433 - Bic does not copy private parameters diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index f3e43cfef..3a8575d7e 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -1694,7 +1694,14 @@ MacLow::ForwardDown (Ptr packet, const WifiMacHeader* hdr, remainingAmpduDuration -= mpduDuration; ampdutag.SetRemainingNbOfMpdus (queueSize - 1); - ampdutag.SetRemainingAmpduDuration (remainingAmpduDuration); + if (queueSize > 1) + { + ampdutag.SetRemainingAmpduDuration (remainingAmpduDuration); + } + else + { + ampdutag.SetRemainingAmpduDuration (NanoSeconds (0)); + } newPacket->AddPacketTag (ampdutag); if (delay == Seconds (0)) @@ -1707,6 +1714,7 @@ MacLow::ForwardDown (Ptr packet, const WifiMacHeader* hdr, } if (queueSize > 1) { + NS_ASSERT (remainingAmpduDuration > 0); delay = delay + mpduDuration; }