tcpdump mailing list archives

Re: select() regression in libpcap-devel?


From: Guy Harris <guy () alum mit edu>
Date: Tue, 21 Jul 2009 23:12:36 -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

There does not appear to be a way for the memory-mapped interface to directly return such an error.

(ie
usb unplugged or driver crash) and instead returns a 'hot' FD constantly
as well... this is a separate issue however :).

"hot" as in readable, or "hot" as in "exceptional condition"?

A quick look at datagram_poll() seems to indicate that it sets POLLERR if sk->sk_err is set, so, at least for poll, the fd will be marked as "hot" in some sense; I couldn't find any obvious indication of whether select() is a system call or a purely userland wrapper around poll(), but, in either case, I'd expect select() to say the descriptor is "hot" in that it'd be listed at least among the error/exceptional condition fds.

It might be that the descriptor will be "stuck" if you don't do a receive from the socket - even if it's memory-mapped - to get the error code.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: