tcpdump mailing list archives
32bit libpcap failure on Linux-ppc64 machine
From: Zvika Meiseles <zvika.meiseles () gmail com>
Date: Sun, 8 May 2011 15:26:17 +0000 (UTC)
Hi,
I'm writing a program that uses packet capture via libpcap. It is built on
multiple platforms and OS's, and runs fine on most of them. However, the
combination of 32 bit binaries on a PPC64 Linux is failing (kernel
2.6.18-194.el5). 64 bit binaries of the same code work fine.
I've narrowed the problem down to the "memory mapped ring buffer" feature
(version 0.9.8 runs fine, >=1.0 fails).
At 1st, I saw that
setsockopt(3, SOL_PACKET, PACKET_RX_RING, ...)
is failing with EBUSY, so I patched the code to call activate_mmap(...) BEFORE
calling iface_bind(...).
Now setsockopt(PACKET_RX_RING) works fine, but I still get the poll() busy-loop.
The symptoms are that no packet data is received by the client application, and
strace shows an endless list of
poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}])
poll() says I have data to read, but it is ignored because the ring buffer
contains data with (status=TP_STATUS_KERNEL), whatever that means... :-)
In my testing, I've used the sniffex.c sample from the tcpdump site
(http://www.tcpdump.org/sniffex.c).
Any ideas as to why this is happening only in this configuration?
Thank you for your help in this matter,
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- 32bit libpcap failure on Linux-ppc64 machine Zvika Meiseles (May 08)
- Re: 32bit libpcap failure on Linux-ppc64 machine Guy Harris (May 08)
- Re: 32bit libpcap failure on Linux-ppc64 machine Zvika Meiseles (May 09)
- Re: 32bit libpcap failure on Linux-ppc64 machine Guy Harris (May 08)
