Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Nov 2002 11:20:13 -0500
From:      Barney Wolff <barney@tp.databus.com>
To:        Petri Helenius <pete@he.iki.fi>
Cc:        Barney Wolff <barney@tp.databus.com>, freebsd-net@FreeBSD.ORG
Subject:   Re: bpf
Message-ID:  <20021106162013.GA60489@tp.databus.com>
In-Reply-To: <05af01c2856a$f103c960$862a40c1@PHE>
References:  <03fe01c28386$186fed80$862a40c1@PHE> <20021103225402.GA28812@tp.databus.com> <05af01c2856a$f103c960$862a40c1@PHE>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 06, 2002 at 10:03:06AM +0200, Petri Helenius wrote:
> 
> The specific problem with bpf is that one might have a half-full buffer
> of captured data when the select timeout hits. In that case the select
> returns with no FDs ready while I think it really should return with
> the bpf fd. (and if you look at the code on sys/net/bpf.c, there is
> timeout handling towards that goal) but I?ve yet to figure out where it goes
> wrong.
> 
> IMO, at timeout the code should check if bd_slen > 0 and if yes,
> do ROTATE_BUFFERS and bpf_wakeup()

The bpf timeout has nothing to do with the select timeout.  Two separate
facilities.

> The functionality I?m looking for is to get all the packets accumulated, say
> in 1 second in single read regardless of if I got a buffer?s full of data.

Then do a select with no FDs just to get a periodic wakeup.  Then at
wakeup do the bpf read, having set nonblocking and immediate mode so you
don't get stuck in the read.

-- 
Barney Wolff         http://www.databus.com/bwresume.pdf
I'm available by contract or FT, in the NYC metro area or via the 'Net.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021106162013.GA60489>