Bug 448 - V4Ping Application Sends uint32_t Data in Host Order
V4Ping Application Sends uint32_t Data in Host Order
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
ns-3-dev
All All
: P1 normal
Assigned To: Rajib Bhattacharjea
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-16 14:46 EST by Craig Dowell
Modified: 2008-12-16 19:53 EST (History)
1 user (show)

See Also:


Attachments
Proposed patch to fix bug. (2.34 KB, patch)
2008-12-16 15:37 EST, Craig Dowell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Dowell 2008-12-16 14:46:36 EST
Sending 32-bit ints as ping data causes regression tests to fail on ppc.

void
V4Ping::StartApplication (void)
{

  ...

  uint32_t data[4];
  data[0] = GetNode ()->GetId ();
  data[1] = GetApplicationId ();
  int64_t now = Simulator::Now ().GetTimeStep ();
  data[2] = now & 0xffffffff;
  now >>= 32;
  data[3] = now & 0xffffffff;

  ...
}

For those with enquiring minds, this is not reported on the nightly regression tests due to another problem (for which Tom will file a separate bug).

Regression testing for machine: darwin-ppc
Darwin 8.11.0 Power Macintosh
powerpc-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5370)
----------------------------- 
SUCCESS: waf -d debug configure; ./waf --regression passed on darwin-ppc 
SUCCESS: waf -d optimized configure; ./waf --regression passed on darwin-ppc
Comment 1 Craig Dowell 2008-12-16 15:37:24 EST
Created attachment 337 [details]
Proposed patch to fix bug.

Patch to send ping data in pcap version of "network" byte order (little endian).
Comment 2 Craig Dowell 2008-12-16 15:38:47 EST
Raj, do you approve?
Comment 3 Rajib Bhattacharjea 2008-12-16 15:46:41 EST
Looks good to me.