summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2003-10-26 22:38:26 -0500
committerNathan Binkert <binkertn@umich.edu>2003-10-26 22:38:26 -0500
commit34adf92749a10970aaa3138912ebeab50973d24d (patch)
tree23e25dc2558c783e2d18392f9f7fbc5359fae9d4
parent5e0b617283e468a273a65744b01f6f907b564f48 (diff)
downloadgem5-34adf92749a10970aaa3138912ebeab50973d24d.tar.xz
only send data to a peer if the peer exists
dev/etherint.hh: only send data to the peer if there is a peer --HG-- extra : convert_revision : 33d90679ed91a2b2842ce4155ac4e58ec3defc22
-rw-r--r--dev/etherint.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/dev/etherint.hh b/dev/etherint.hh
index 1aa85f17c..dfc9f6fd6 100644
--- a/dev/etherint.hh
+++ b/dev/etherint.hh
@@ -56,7 +56,10 @@ class EtherInt : public SimObject
void setPeer(EtherInt *p);
virtual bool recvPacket(PacketPtr packet) = 0;
void recvDone() { peer->sendDone(); }
- bool sendPacket(PacketPtr packet) { return peer->recvPacket(packet); }
+ bool sendPacket(PacketPtr packet)
+ {
+ return peer ? peer->recvPacket(packet) : true;
+ }
virtual void sendDone() = 0;
};