Skip to content

Commit

Permalink
lte: Fix EPC test crashes by removing an assert
Browse files Browse the repository at this point in the history
That's bad, usually the test must be reworked to not fail the assert.
However, there's no time in fixing a decade-old test, and also the code
worked like this since... forever. My fault was to add the assert in the first
instance, thinking that it would be a good service to the users. I was wrong.
  • Loading branch information
natale-p committed Mar 12, 2019
1 parent 79f127c commit c8c919d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/lte/helper/point-to-point-epc-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,17 @@ PointToPointEpcHelper::DoActivateEpsBearerForUe (const Ptr<NetDevice> &ueDevice,
const EpsBearer &bearer) const
{
NS_LOG_FUNCTION (this);
Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice> ();
NS_ABORT_MSG_IF (ueLteDevice == nullptr , "Unable to find LteUeNetDevice while activating the EPS bearer");

Simulator::ScheduleNow (&EpcUeNas::ActivateEpsBearer, ueLteDevice->GetNas (), bearer, tft);
Ptr<LteUeNetDevice> ueLteDevice = DynamicCast<LteUeNetDevice> (ueDevice);
if (ueLteDevice == nullptr)
{
// You may wonder why this is not an assert. Well, take a look in epc-test-s1u-downlink
// and -uplink: we are using CSMA to simulate UEs.
NS_LOG_WARN ("Unable to find LteUeNetDevice while activating the EPS bearer");
}
else
{
Simulator::ScheduleNow (&EpcUeNas::ActivateEpsBearer, ueLteDevice->GetNas (), bearer, tft);
}
}

Ptr<Node>
Expand Down

0 comments on commit c8c919d

Please sign in to comment.