From 34adf92749a10970aaa3138912ebeab50973d24d Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 26 Oct 2003 22:38:26 -0500 Subject: [PATCH] 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 --- dev/etherint.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; };