aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-usb-linux.c
diff options
context:
space:
mode:
authorguy <guy>2007-12-14 08:02:40 +0000
committerguy <guy>2007-12-14 08:02:40 +0000
commit1952d35b3704fa3fcc32c937ecb28bced6fd79f0 (patch)
tree540d695e9703e780fd3d40c1cf70485f19c2e468 /pcap-usb-linux.c
parent25ccbe6e868f8a4bff229084aa8f3d650f6d5aab (diff)
Handle the case where mmap()ped access to the USB buffer is used;
hopefully I'm inferring correctly from the mon_bin_poll() routine that, even with purely-mmapped access, you can use select() or poll() to wait for packets to arrive.
Diffstat (limited to 'pcap-usb-linux.c')
-rw-r--r--pcap-usb-linux.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
index a457d0b..5164c8f 100644
--- a/pcap-usb-linux.c
+++ b/pcap-usb-linux.c
@@ -34,7 +34,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.19 2007-12-14 07:52:32 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.20 2007-12-14 08:02:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -232,6 +232,12 @@ usb_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errms
handle->stats_op = usb_stats_linux_bin;
handle->read_op = usb_read_linux_mmap;
handle->close_op = usb_close_linux_mmap;
+
+ /*
+ * "handle->fd" is a real file, so "select()" and
+ * "poll()" work on it.
+ */
+ handle->selectable_fd = handle->fd;
return handle;
}