summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev/etherlink.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/dev/etherlink.cc b/dev/etherlink.cc
index f5c47bd22..e0f45c3bf 100644
--- a/dev/etherlink.cc
+++ b/dev/etherlink.cc
@@ -159,9 +159,11 @@ EtherLink::Link::transmit(PacketPtr pkt)
DDUMP(EthernetData, pkt->data, pkt->length);
packet = pkt;
- Random<Tick> var;
- Tick delay = (Tick)ceil(((double)pkt->length * ticksPerByte) + 1.0 +
- var.uniform(delayVar));
+ Tick delay = (Tick)ceil(((double)pkt->length * ticksPerByte) + 1.0);
+ if (delayVar != 0) {
+ Random<Tick> var;
+ delay += var.uniform(delayVar);
+ }
DPRINTF(Ethernet, "scheduling packet: delay=%d, (rate=%f)\n",
delay, ticksPerByte);
doneEvent.schedule(curTick + delay);