From owner-freebsd-net Sun Nov 3 14:54:10 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2F5B37B401 for ; Sun, 3 Nov 2002 14:54:08 -0800 (PST) Received: from tp.databus.com (p70-227.acedsl.com [66.114.70.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 324B343E7B for ; Sun, 3 Nov 2002 14:54:08 -0800 (PST) (envelope-from barney@tp.databus.com) Received: from tp.databus.com (localhost.databus.com [127.0.0.1]) by tp.databus.com (8.12.6/8.12.6) with ESMTP id gA3Ms25s028859; Sun, 3 Nov 2002 17:54:02 -0500 (EST) (envelope-from barney@tp.databus.com) Received: (from barney@localhost) by tp.databus.com (8.12.6/8.12.6/Submit) id gA3Ms2mV028858; Sun, 3 Nov 2002 17:54:02 -0500 (EST) Date: Sun, 3 Nov 2002 17:54:02 -0500 From: Barney Wolff To: Petri Helenius Cc: freebsd-net@FreeBSD.ORG Subject: Re: bpf Message-ID: <20021103225402.GA28812@tp.databus.com> References: <03fe01c28386$186fed80$862a40c1@PHE> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03fe01c28386$186fed80$862a40c1@PHE> User-Agent: Mutt/1.4i X-Scanned-By: MIMEDefang 2.24 (www . roaringpenguin . com / mimedefang) Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I believe you're misunderstanding the meaning of the timeout in select(2). Timeout applies only when no FDs are ready. Also, you might be better off setting immediate mode on your bpf fd, if you want a return before the buffer is full. On Mon, Nov 04, 2002 at 12:12:26AM +0200, Petri Helenius wrote: > > I believe the select operation on bpf is not functioning as supposed to. > I?m calling select with 100ms timeout. The bpf interface is listening to > an interface with constant packet rate, so it?s certain that multiple packets > have been received during the select call. However the fd for the bpf > device is not set until the bpf buffer is full. (which might be several seconds > away since I?m using fairly large bpf buffers) > > Looking at the code I get the impression that if there are packets on the bpf > buffer when the select timeouts, it should return the fd for the bpf ? > > Pete > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message -- 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