tcpdump mailing list archives

Re: select() regression in libpcap-devel?


From: Guy Harris <guy () alum mit edu>
Date: Wed, 24 Jun 2009 14:21:44 -0700


On Jun 24, 2009, at 1:40 PM, Mike Kershaw wrote:

Yes, it's linux, sorry for not including that.

As you might guess, I suspected it was a problem with the memory- mapped capture stuff in Linux; that and the FreeBSD memory-mapped capture stuff were the most likely 1.0 changes to cause this, although...

dragorn@drd1813 ~/src/libpcap $ tcpdump -V
tcpdump version 4.1-PRE-CVS_2009_06_22
libpcap version 1.1-PRE-CVS

...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.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: