fix PR#847 Segfaults on BaseStationNetDevice with OnOffApplication and rtPS sched

This commit is contained in:
Mohamed Amine Ismail
2010-03-19 20:58:23 +01:00
parent e29521786d
commit d5195f6d6e
2 changed files with 13 additions and 7 deletions

View File

@@ -226,7 +226,6 @@ BSSchedulerRtps::BSSchedulerBroadcastConnection (uint32_t &availableSymbols)
packet = connection->GetQueue ()->Peek (hdr);
nrSymbolsRequired = GetBs ()->GetPhy ()->GetNrSymbols (packet->GetSize (), modulationType);
// PIRO: check for fragmentation
if (availableSymbols < nrSymbolsRequired
&& !CheckForFragmentation (connection, availableSymbols, modulationType))
{
@@ -460,15 +459,18 @@ BSSchedulerRtps::BSSchedulerUGSConnection (uint32_t &availableSymbols)
nrSymbolsRequired = connection->GetServiceFlow ()->GetRecord ()->GetGrantSize ();
// PIRO: packet fragmentation for UGS connections has not been implemented yet!
// Packet fragmentation for UGS connections has not been implemented yet!
if (availableSymbols > nrSymbolsRequired)
{
availableSymbols -= nrSymbolsRequired;
burst = CreateUgsBurst (connection->GetServiceFlow (), modulationType, nrSymbolsRequired);
AddDownlinkBurst (connection, diuc, modulationType, burst);
currentTime = Simulator::Now ();
serviceFlowRecord->SetDlTimeStamp (currentTime);
burst = Create<PacketBurst> ();
if (burst->GetNPackets () != 0)
{
AddDownlinkBurst (connection, diuc, modulationType, burst);
currentTime = Simulator::Now ();
serviceFlowRecord->SetDlTimeStamp (currentTime);
burst = Create<PacketBurst> ();
}
}
}
}
@@ -562,6 +564,7 @@ BSSchedulerRtps::BSSchedulerRTPSConnection (uint32_t &availableSymbols)
// Downlink Bandwidth Allocation
for (int i = 0; i < nbConnection; i++)
{
packet = rtPSConnection[i]->GetQueue ()->Peek (hdr);
uint32_t symbolsForPacketTransmission = 0;
burst = Create<PacketBurst> ();

View File

@@ -76,7 +76,10 @@ Ptr<PacketBurst> PacketBurst::Copy (void) const
void
PacketBurst::AddPacket (Ptr<Packet> packet)
{
m_packets.push_back (packet);
if (packet)
{
m_packets.push_back (packet);
}
}
std::list<Ptr<Packet> >