tcpdump mailing list archives

Re: [PACTH] enable memory mapped access to ethernet


From: Guy Harris <guy () alum mit edu>
Date: Fri, 14 Dec 2007 00:24:00 -0800

Paolo Abeni wrote:

Any comments on this matter or on the patch are very welcome !

If, in pcap_open_live(), live_open_mmap() succeeds, handle->selectable_fd doesn't get set.

This will break, among other programs, the current version of Wireshark, and the upcoming version of Wireshark. (A similar problem in pcap-usb-linux.c appear to have already broken USB capture; see recent mails in the wireshark-dev mailing list.)

If live_open_mmap() succeeded, can a select() or poll() on the mapped FD be done to wait for packets to arrive? If so, you need to set handle->selectable_fd to handle->fd before returning. If *not*, you need to set it to -1 before returning, to indicate that you can't use select() or poll() to wait for packets to arrive.

(While we're on that topic, can select() or poll() be used for USB capture? I've checked in changes to pcap-usb-linux.c that assume it can; if not, it needs to set handle->selectable_fd to -1 in the memory-mapped case.)
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: