Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(261)

Unified Diff: src/network/utils/simple-net-device.cc

Issue 45320043: New Simple applications (Closed)
Patch Set: Small changes to allow infinite sending Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/network/utils/simple-net-device.cc
===================================================================
--- a/src/network/utils/simple-net-device.cc
+++ b/src/network/utils/simple-net-device.cc
@@ -216,6 +216,10 @@
SimpleNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber)
{
NS_LOG_FUNCTION (this << packet << dest << protocolNumber);
+ if (packet->GetSize () > GetMtu ())
+ {
+ return false;
+ }
Mac48Address to = Mac48Address::ConvertFrom (dest);
m_channel->Send (packet, protocolNumber, to, m_address, this);
return true;
@@ -224,6 +228,10 @@
SimpleNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
{
NS_LOG_FUNCTION (this << packet << source << dest << protocolNumber);
+ if (packet->GetSize () > GetMtu ())
+ {
+ return false;
+ }
Mac48Address to = Mac48Address::ConvertFrom (dest);
Mac48Address from = Mac48Address::ConvertFrom (source);
m_channel->Send (packet, protocolNumber, to, from, this);

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b