Fix valgrind error for icmpv6-redirect example.
authorSebastien Vincent <vincent@clarinet.u-strasbg.fr>
Thu, 08 Oct 2009 17:31:58 +0200
changeset 5387 52b6b55635c4
parent 5386 e989563ab376
child 5389 3f6ff1b85179
child 5400 56737002c3c7
Fix valgrind error for icmpv6-redirect example.
src/internet-stack/icmpv6-l4-protocol.cc
--- a/src/internet-stack/icmpv6-l4-protocol.cc	Thu Oct 08 12:56:47 2009 +0200
+++ b/src/internet-stack/icmpv6-l4-protocol.cc	Thu Oct 08 17:31:58 2009 +0200
@@ -962,7 +962,8 @@
 
   if ((redirectedPacketSize % 8) != 0)
   {
-    redirectedPacket->AddPaddingAtEnd (8 - (redirectedPacketSize % 8));
+    Ptr<Packet> pad = Create<Packet>(8 - (redirectedPacketSize % 8));
+    redirectedPacket->AddAtEnd (pad); 
   }
 
   if (redirHardwareTarget.GetLength ())