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
This commit is contained in:
Nathan Binkert 2003-10-26 22:38:26 -05:00
parent 5e0b617283
commit 34adf92749

View file

@ -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;
};