dev, dist: Fixed a scheduling bug in the etherswitch

This patch fixes a bug in etherswitch. When a packet gets inserted
in the output fifo, the txEvent has to always be reschedule,
not only when an event is already scheduled. This can raise
the assertion in the reschedule function.
This commit is contained in:
Mohammad Alian 2016-07-19 09:48:56 -05:00
parent e9d0f6db88
commit c7bf0e9cdd

View file

@ -172,7 +172,7 @@ EtherSwitch::Interface::enqueue(EthPacketPtr packet, unsigned senderId)
// to send this packet out the external link
// otherwise, there is already a txEvent scheduled
if (outputFifo.push(packet, senderId)) {
parent->reschedule(txEvent, curTick() + switchingDelay());
parent->reschedule(txEvent, curTick() + switchingDelay(), true);
}
}