Nathan Jennings said:
I'm using the attached patch (against latest svn) successfully on FreeBSD 4.9-RELEASE to prevent UI hangs during captures. In other words, without the patch, which enables select() on the BPF pcap fd, the main window and capture info dialog will not respond to input unless traffic matching the capture filter continues filling the buffer.
That sounds like a FreeBSD 4.9 bug - one that would also cause tcpdump, when run without the -w flag, not to print any packets until traffic matching the capture filter fills the buffer.
Perhaps adding kqueue support to BPF broke things - but there's nothing obvious in the differences between 4.6 (which definitely works) and 4.9 that would break things,
http://lists.freebsd.org/pipermail/freebsd-bugs/2004-March/005856.html
so you should test with tcpdump on a low-traffic network to see if the symptoms in question occur.
Anyway, getting back to Ethereal...
Thanks for your feedback and help, -Nathan
Index: configure.in =================================================================== --- configure.in (revision 12628) +++ configure.in (working copy) @@ -636,6 +636,25 @@ AC_ETHEREAL_PCAP_CHECK fi +# +# Check if select should be forced for use on libpcap file descriptors. +# (Used to override bugs in some kernels; for example FreeBSD.) +# +AC_ARG_ENABLE(pcap-select, + [ --enable-pcap-select use select on libpcap file descriptors. [default=no]], + enable_pcap_select=$enableval, + enable_pcap_select=no) +#AM_CONDITIONAL(MUST_DO_SELECT, test x$enable_pcap_select = xyes) +if test $want_pcap = yes ; then + AC_MSG_CHECKING(whether to use select on libpcap file descriptors) + if test "x$enable_pcap_select" = "xno" ; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + AC_DEFINE(MUST_DO_SELECT,, [Define to force use of select on libpcap file descriptors.]) + fi +fi + dnl zlib check AC_MSG_CHECKING(whether to use zlib for reading compressed capture files) @@ -1298,6 +1317,12 @@ snmp_libs_message="yes (ucd-snmp)" fi +if test "x$enable_pcap_select" = "xyes" ; then + pcap_select_message="yes" +else + pcap_select_message="no" +fi + echo "" echo "The Ethereal package has been configured with the following options." echo " Build ethereal : $enable_ethereal" @@ -1318,6 +1343,7 @@ echo " Build profile binaries : $enable_profile_build" fi echo " Use pcap library : $want_pcap" +echo " Use select for pcap library : $pcap_select_message" echo " Use zlib library : $zlib_message" echo " Use pcre library : $pcre_message" echo " Use kerberos library : $krb5_message" Index: capture_loop.c =================================================================== --- capture_loop.c (revision 12628) +++ capture_loop.c (working copy) @@ -118,10 +118,16 @@ * XXX - the various BSDs appear to define BSD in <sys/param.h>; we don't * want to include it if it's not present on this platform, however. */ -#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \ - !defined(__bsdi__) && !defined(__APPLE__) && !defined(_WIN32) && \ - !defined(__CYGWIN__) -# define MUST_DO_SELECT + +/* Skip if already defined. + * (User told "configure" to force use of select.) + */ +#ifndef MUST_DO_SELECT +# if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \ + !defined(__bsdi__) && !defined(__APPLE__) && !defined(_WIN32) && \ + !defined(__CYGWIN__) +# define MUST_DO_SELECT +# endif #endif
Powered by MHonArc 2.6.10