#1 Fix leading zeros of packetTime

open
nobody
None
5
2007-09-13
2007-09-13
Anonymous
No

capturemodule.c does not preserve the correct magnitude of the microseconds from ts.tv_usec. For example, a packet with a correct timestamp of

1189639796.002450

is returned by pycap as

1189639796.245000

I fixed this by changing the sprintf() on line 125 from

sprintf(buffer, "%ld.%ld", (long) header.ts.tv_sec, (long) header.ts.tv_usec);

to

sprintf(buffer, "%ld.%06ld", (long) header.ts.tv_sec, (long) header.ts.tv_usec);

Context diff is attached.

Discussion

  • Patch capturemodule.c to correct microseconds in packet timestamp