Consider the following scenario:
Process A initializes the pcap handle
Process A forks process B that call pcap_loop
Every once in a while process A kills process B forks a new process B and calls pcap_loop again.
This works well two-three times, after which the newly forked processes seem to receive no event whatsoever.
Demo code in attachment.
I'm not seeing that behavior on my Mac OS X 10.6.4 machine. (I modified the program to take an optional argument, specifying the interface on which to capture, as the default interface on my machine is en0, but that's the Ethernet, which is rarely plugged in - I need to capture on en1, the AirPort interface.)
On what version of what OS are you seeing this? Which version of libpcap are you using?
Administrators of the "libpcap" SourceForge project have superseded this tracker item (formerly artifact 3074646, now bug 142) with issue 144 of the "libpcap" GitHub project.