From 6ecdd3922742dc62fffe1e2083462be0e692f0f8 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 29 Dec 2010 10:14:43 -0800 Subject: [PATCH] more verbose assert message when MTU exceeded --- src/internet-stack/ipv4-l3-protocol.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/internet-stack/ipv4-l3-protocol.cc b/src/internet-stack/ipv4-l3-protocol.cc index 2e647e74e..eefcbb5b1 100644 --- a/src/internet-stack/ipv4-l3-protocol.cc +++ b/src/internet-stack/ipv4-l3-protocol.cc @@ -695,7 +695,10 @@ Ipv4L3Protocol::SendRealOut (Ptr route, Ptr 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 ())