When you try to read a pcapng file and save it to a new pcapng file, the timestamp was trimmed down! The decimal place is moved to the front and the last digit is rounded off. The timestamp is no longer correct. Could anyone please help how to correct it? Thanks a lot!
asked 02 Jul ‘12, 20:54 Holy edited 03 Jul ‘12, 16:08 Guy Harris ♦♦ |
2 Answers:
I tried this in 1.8.0 (well, actually the trunk) and did not have the problem. Are you using 1.8.0 or a previous version? If you're using an older version, please upgrade. If you're using 1.8.0, please file a bug report. answered 03 Jul '12, 11:35 JeffMorriss ♦ |
That's not losing precision, that's getting significantly changed - the integer portions of 1340398414.509256500 and 134039841.450925600 are significantly different. Please file a bug against whatever versions of Wireshark have this problem, even if it's prior to 1.8.0. TShark might be failing to set the time stamp resolution correctly in the Interface Description Block(s) in the output file:
so the resolution might be off by a factor of 10. answered 03 Jul '12, 16:12 Guy Harris ♦♦ |
Thank you for your quick response!
I checked that my if_tsresol field in the original IS block is 7. So effectively the timestamp lost its least significant digit but the program still wanted to maintain the original number of decimal places. As a result, the decimal point is moved to the front by 1 digit.
I am using:
libpcap-1.3.0
wireshark-1.8.0 ( downloaded from http://www.wireshark.org/download.html )
Are there any other components that may affect the precision?
Thanks again!
I don't know. Please file a bug on this on the Wireshark Bugzilla, so that we can track it and note when it's fixed.
It's here now: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7457
Fixed in rev 43649, and fix backported to the 1.8 branch, so it'll be fixed in 1.8.1. It's not TShark-specific - anything that reads pcap-ng files with an interface that doesn't have the default 1-microsecond time stamp resolution and writes out packets from that interface will get it wrong.