diff options
author | Richard van der Hoff <richardv@mxtelecom.com> | 2007-08-24 15:34:08 +0000 |
---|---|---|
committer | Richard van der Hoff <richardv@mxtelecom.com> | 2007-08-24 15:34:08 +0000 |
commit | 924f2d928dc514ed4496d7cb22fbe8bf2a55e9f7 (patch) | |
tree | 0435884b8b905a3e67a14ee2e548f56c5386a4c8 /capture_loop.h | |
parent | 56d329f7e967b75aa2e0f3ade027181137734ea0 (diff) |
Fix bug 1181 by always using select() on a capture fd on linux
svn path=/trunk/; revision=22639
Diffstat (limited to 'capture_loop.h')
-rw-r--r-- | capture_loop.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/capture_loop.h b/capture_loop.h index bd2d3d82c9..8f8100b672 100644 --- a/capture_loop.h +++ b/capture_loop.h @@ -48,7 +48,7 @@ extern void capture_loop_stop(void); /*** the following is internal only (should be moved to capture_loop_int.h) ***/ - +#if !defined (__linux__) #ifndef HAVE_PCAP_BREAKLOOP /* * We don't have pcap_breakloop(), which is the only way to ensure that @@ -92,6 +92,13 @@ extern void capture_loop_stop(void); # define MUST_DO_SELECT # endif /* avoid select */ #endif /* HAVE_PCAP_BREAKLOOP */ +#else /* linux */ +/* whatever the deal with pcap_breakloop, linux doesn't support timeouts + * in pcap_dispatch(); on the other hand, select() works just fine there. + * Hence we use a select for that come what may. + */ +#define MUST_DO_SELECT +#endif typedef void (*capture_packet_cb_fct)(u_char *, const struct pcap_pkthdr *, const u_char *); |