Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

pcap tv_usec inaccurate

by gman (Friar)
on Apr 04, 2014 at 21:32 UTC ( [id://1081195]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1081195]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2025-11-06 21:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (65 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.