From cd353a538fea2fc58a8116e488a03ef77f022ae4 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Fri, 27 May 2022 19:47:04 +0000 Subject: [PATCH] csma: Avoid scheduling Receive() on own NetDevice --- src/csma/model/csma-channel.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/csma/model/csma-channel.cc b/src/csma/model/csma-channel.cc index eeb5a4249..ac0a6ee8b 100644 --- a/src/csma/model/csma-channel.cc +++ b/src/csma/model/csma-channel.cc @@ -223,10 +223,9 @@ CsmaChannel::TransmitEnd () NS_LOG_LOGIC ("Receive"); std::vector::iterator it; - uint32_t devId = 0; for (it = m_deviceList.begin (); it < m_deviceList.end (); it++) { - if (it->IsActive ()) + if (it->IsActive () && it->devicePtr != m_deviceList[m_currentSrc].devicePtr) { // schedule reception events Simulator::ScheduleWithContext (it->devicePtr->GetNode ()->GetId (), @@ -234,7 +233,6 @@ CsmaChannel::TransmitEnd () &CsmaNetDevice::Receive, it->devicePtr, m_currentPkt->Copy (), m_deviceList[m_currentSrc].devicePtr); } - devId++; } // also schedule for the tx side to go back to IDLE