From: Nathan Binkert Date: Mon, 27 Oct 2003 03:38:26 +0000 (-0500) Subject: only send data to a peer if the peer exists X-Git-Tag: m5_1.0_beta2~350 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34adf92749a10970aaa3138912ebeab50973d24d;p=gem5.git 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 --- 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; };