Re: [tcpdump-workers] pcap_read_linux_mmap() not returning packets on time

2013-09-11 Thread Cristian Morales Vega
The simple version is that I am seeing poll repeatedly returning POLLIN but when pcap checks the mmaped memory it finds TP_STATUS_USER is not set. >From what I can see the only thing poll (net/packet/af_packet.c:net/packet/af_packet.c) does is check if TP_STATUS_USER is set. So, could it be that p

[tcpdump-workers] pcap_read_linux_mmap() not returning packets on time

2013-09-11 Thread Cristian Morales Vega
I am having a problem using libpcap in my program and I would like a bit of guidance before I try to understand how Linux PACKET_MMAP works. Using an unpatched libpcap 1.4.0 (and a OpenWRT patched 1.1.1) I find this call: pcap_dispatch(pcap_descr, -1, placeholder, NULL); after a blocking, succe

[tcpdump-workers] Problem with pcap_set_datalink DLT_IEEE802_11_RADIO

2013-09-11 Thread Elton Lika
I am using libpcap-dev 0.9.8 in Ubuntu 12.04 on my laptop. Setting my wlan0 interface to monitor mode using iwconfig and tcpdump -i wlan0 -y IEEE802_11_RADIO works fine but when doing it in C it fails with an DLT not supported by device error. Here is the source code excerpt that fails: