Skip to content

Commit

Permalink
wifi: Fix crashing simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
sderonne committed Feb 3, 2019
1 parent f0e48d7 commit 5fdef87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wifi/model/block-ack-manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ BlockAckManager::CleanupBuffers (void)
continue;
}
Time now = Simulator::Now ();
for (PacketQueueI i = j->second.second.begin (); i != j->second.second.end (); i++)
for (PacketQueueI i = j->second.second.begin (); i != j->second.second.end (); )
{
if (i->timestamp + m_maxDelay > now)
{
Expand All @@ -899,9 +899,11 @@ BlockAckManager::CleanupBuffers (void)
j->second.first.GetTid (),
i->hdr.GetSequenceNumber ());
j->second.first.SetStartingSequence ((i->hdr.GetSequenceNumber () + 1) % 4096);
j->second.second.erase (i);
i = j->second.second.erase (i);
removed = true;
continue;
}
i++;
}
if (removed)
{
Expand Down

0 comments on commit 5fdef87

Please sign in to comment.