tcpdump mailing list archives

Re: select() regression in libpcap-devel?


From: Guy Harris <guy () alum mit edu>
Date: Mon, 12 Oct 2009 17:31:24 -0700


On Jun 23, 2009, at 7:34 PM, Mike Kershaw wrote:

(This now actually hits my error catcher where 100 fd highs in a row
with no packets triggers a shutdown of the source, since libpcap-1.0.0
seems to not return errors in pcap_dispatch when a netdev is removed (ie usb unplugged or driver crash) and instead returns a 'hot' FD constantly
as well... this is a separate issue however :).

It should now do the right thing when a netdev is removed, regardless of whether you're just using pcap_loop()/pcap_dispatch()/pcap_next()/ pcap_next_ex(), using select(), or using poll() - i.e., you don't have to use poll() in order to get the "netdev removed" indication (if there are no packets available in the ring, libpcap will do a poll() even in non-blocking mode, to pick up the indication - it just uses a timeout of 0 if in non-blocking mode, so that the poll checks for packets available or an error but doesn't wait for either one).
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: