Ethereal-dev: Re: [Ethereal-dev] captures on FreeBSD hang UI (potential patch)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Guy Harris" <gharris@xxxxxxxxx>
Date: Thu, 11 Nov 2004 22:55:04 -0800 (PST)
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, so you should test with tcpdump on a low-traffic
network to see if the symptoms in question occur.

> Does anyone have any concerns with using the patch

Yes; my concern is that it shouldn't be necessary in the first place, and
that the underlying problem might not have been identified or might have
been mis-identified.

(Or, to put it another way, my concern is that what's being patched is
capture.c in Ethereal rather than sys/net/bpf.c in FreeBSD.)

> BTW, the FreeBSD ports maintainer patched the 0.10.{5|6} version by
> ripping "__FreeBSD__" out of the entire #if conditional. My attached
> patch only includes select() for 4.9 and 4.10. I haven't tested other
> versions. I suppose he thinks it's safe for all FreeBSDs for some reason.

Perhaps the maintainer either

    1) is doing that only for the 5.x ports collection

or

    2) doesn't realize that there are versions of FreeBSD where select
doesn't work on BPF devices.