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:
parent
5e0b617283
commit
34adf92749
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue