more verbose assert message when MTU exceeded
authorTom Henderson <tomh@tomh.org>
Wed, 29 Dec 2010 10:14:43 -0800
changeset 6733 6937fdb5a5af
parent 6732 fcb93aa1a2a8
child 6734 cb3a5773cb24
more verbose assert message when MTU exceeded
src/internet-stack/ipv4-l3-protocol.cc
--- a/src/internet-stack/ipv4-l3-protocol.cc	Wed Dec 29 09:31:47 2010 -0800
+++ b/src/internet-stack/ipv4-l3-protocol.cc	Wed Dec 29 10:14:43 2010 -0800
@@ -695,7 +695,10 @@
   Ptr<Ipv4Interface> outInterface = GetInterface (interface);
   NS_LOG_LOGIC ("Send via NetDevice ifIndex " << outDev->GetIfIndex () << " ipv4InterfaceIndex " << interface);
 
-  NS_ASSERT (packet->GetSize () <= outInterface->GetDevice ()->GetMtu ());
+  NS_ASSERT_MSG (packet->GetSize () <= outInterface->GetDevice ()->GetMtu (), 
+      "Packet size " << packet->GetSize () << " exceeds device MTU " 
+      << outInterface->GetDevice ()->GetMtu () 
+      << " for IPv4; fragmentation not supported");
   if (!route->GetGateway ().IsEqual (Ipv4Address ("0.0.0.0"))) 
     {
       if (outInterface->IsUp ())