gman has asked for the wisdom of the Perl Monks concerning the following question:

UPDATE: I have yet to test this, but it looks like I have fallen for <a href="https://rt.cpan.org/Public/Bug/Display.html?id=26937"26937 as Corion suggested.

UPDATE: I found http://cpansearch.perl.org/src/TIMPOTTER/Net-Pcap-0.04/Pcap.xs
But I need help going through it

Hello all,

I have a problem with Net::Pcap and i'm not sure of the source of the problem.
Here is the root of the problem;

INV 1396377544.853700 should be 1396377544.085370000 From tcpdump on same system: 1396377544.085370 IP 192.168.0.1.sip > 1 +92.168.0.2.sip: SIP, length: 1391

my code is;

... Net::Pcap::loop( $pcap, -1, \&pkt_proc, "$filename" ); ... my $tv_usec = $hdr->{'tv_usec'}; ...

It looks like the timeval structure is in perl CORE, but I really have not been able to trace it that back to a perl lib or a c lib pcap.h/libcap seem to work fine. The I need help identifying the problem as I have been unable to.

thanks!!!!!!

Replies are listed 'Best First'.
Re: pcap tv_usec inaccurate
by Corion (Patriarch) on Apr 04, 2014 at 22:03 UTC

    Net::Pcap has much more recent versions. What version are you actually using, and are you using the latest release? Also, are you sure that the error is in the determination of the values and not in the output?

    Maybe you can show us a small, self-contained script that exhibits the behaviour so that we can reproduce the problem?

      Thanks Corion,

      I will have to work on trying to remove the IP addresses, although I don't see it as a big deal other might. I will also first try updating Net::Pcap to the latest. These systems are using Ubuntu LTS so they lag behind I guess.