tcpdump mailing list archives

Re: select() regression in libpcap-devel?


From: Guy Harris <guy () alum mit edu>
Date: Fri, 3 Jul 2009 14:47:14 -0700


On Jun 24, 2009, at 2:21 PM, Guy Harris wrote:

...does this happen with standard 1.0? If not, this might be a side- effect of a bug fix in top-of-tree - it turns out that you are *not* finished with a packet when the callback returns; consider how pcap_next() and pcap_next_ex() are implemented - they call the callback and, when it returns, hand the packet back. That's not an issue when the packet buffer is owned solely by libpcap, but if it's shared between the kernel and libpcap, the kernel might reuse a buffer slot in the memory-mapped region after libpcap releases it, so it can't release it until the *next* packet is read.

Yup, that was it. I've backed out that bug fix (checked in and pushed); I'll re-fix the bug by having the callback pcap_next() and pcap_next_ex(), when the capture is in Linux memory-mapped mode, make a copy of the packet and return that.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: