djhenderson / dpkt

Automatically exported from code.google.com/p/dpkt
Other
1 stars 0 forks source link

dpkt.pcap.Writer bug #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use dpkt.pcap.Reader to read a pcap file
2. use dpkt.pcap.Writer to write it in a new file

What is the expected output? What do you see instead?
The expected output is a positive microsecond number instead a negative
number is stored. 

What version of the product are you using? On what operating system?
Latest stable version of dpkt, on Ubuntu 9.04

Please provide any additional information below.
Small issue. It can be easily fixed by interchanging the two numbers. 
Instead of 
pcap.py:81:tv_usec=int((int(ts) - float(ts)) * 1000000.0),
use        tv_usec=int((float(ts) - int(ts)) * 1000000.0);

Original issue reported on code.google.com by rayvince...@gmail.com on 15 Oct 2009 at 11:37

GoogleCodeExporter commented 9 years ago
This was fixed a while back in r25:

http://code.google.com/p/dpkt/source/detail?r=26&path=/trunk/dpkt/pcap.py

I'd recommend using SVN until we cut a new release.

Original comment by jon.ober...@gmail.com on 24 Mar 2010 at 3:00