tcpdump mailing list archives

Re: error executing ksniff with libpcap 1.0.0


From: Guy Harris <guy () alum mit edu>
Date: Tue, 18 Nov 2008 12:52:18 -0800


On Nov 17, 2008, at 3:24 PM, Giovanni Venturi wrote:

int result = 9;
result = pcap_next_ex(m_pcapfp, &hdr, (const u_char **)&p);

Sometimes I get 9, sometimes I get 1, ...

How can it be possible that the return value doesn't change result variable?

If you *truly* set a variable to, say, 9, and then later set it from the return value of a function, and immediately after setting it from the return value of the function it still has the value you originally set it to, then either

        1) there's a hardware problem on your machine;

        2) there's a compiler problem on your machine;

        3) the function sometimes returns 9.

I went through the pcap_next_ex() code path on Linux - it can't return 9 when doing a live capture. That leaves a hardware or compiler problem....
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: