Bug 1050: Part 2
authorJohn Abraham <john.abraham@gatech.edu>
Wed, 10 Aug 2011 19:00:07 -0400
changeset 7421 e5aae1299831
parent 7420 ca9c09839724
child 7422 a88a2275cefa
Bug 1050: Part 2
src/applications/model/v4ping.cc
--- a/src/applications/model/v4ping.cc	Wed Aug 10 10:59:35 2011 -0700
+++ b/src/applications/model/v4ping.cc	Wed Aug 10 19:00:07 2011 -0400
@@ -123,11 +123,11 @@
 
           if (i != m_sent.end () && echo.GetIdentifier () == 0)
             {
-              uint32_t * buf = new uint32_t [m_size / 4];
+              uint32_t * buf = new uint32_t [m_size];
               uint32_t dataSize = echo.GetDataSize ();
               uint32_t nodeId;
               uint32_t appId;
-              if (dataSize == sizeof(buf))
+              if (dataSize == m_size)
                 {
                   echo.GetData ((uint8_t *)buf);
                   Read32 ((const uint8_t *) &buf[0], nodeId);
@@ -204,7 +204,7 @@
   tmp = GetApplicationId ();
   Write32 (&data[1 * sizeof(uint32_t)], tmp);
 
-  Ptr<Packet> dataPacket = Create<Packet> ((uint8_t *) &data, m_size);
+  Ptr<Packet> dataPacket = Create<Packet> ((uint8_t *) data, m_size);
   echo.SetData (dataPacket);
   p->AddHeader (echo);
   Icmpv4Header header;