Ethereal-dev: Re: [ethereal-dev] ethereal freeze if there is no traffic on the network

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sun, 29 Aug 1999 14:42:11 -0700
> The problem is due to function pcap_dispatch(): it blocks until a packet is
> caugth and never time outs.

You're probably running Linux, right?  Unfortunately, vanilla "libpcap"
doesn't support timeouts in live captures on Linux - Linux's SOCK_PACKET
mechanism , unlike the raw-packet-access mechanims of most other
platforms supported by "libpcap", doesn't support a timeout facility, so
you need to do something such as using "select()".  (The 2.2[.x] packet
filter mechanism might have it, but vanilla "libpcap" doesn't use it.)

> This problem is due to pcap libraries.
> I have done a little patch to pcap library to fix this and submitted it to
> libpcap developers.

Yup.  We also have a "libpcap" patch under

	http://ethereal.zing.org/~gerald/libpcap-0.4-guy-gerald.patch

that may be similar to your patch; I'm probably missing something, but I
don't see anything in the Ethereal README or INSTALL file that mentions
that you have to patch "libpcap" to make it work well on Linux systems -
we should probably mention that.

I don't know when LBL will come out with a new version of "libpcap" with
your patch (or any of the other patches people may have submitted to use
the Linux 2.2[.x] packet filter mechanism and filter out packets before
copying them to userland, or better handle systems with 64-bit "tv_sec"
and "tv_usec" fields in "struct timeval", or whatever); you might want
to send your patch to "ethereal-dev" so we could merge it with our patch
(yours might be better in some or all ways than ours).