From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 8 00:43:22 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A83D316A4BF for ; Mon, 8 Sep 2003 00:43:22 -0700 (PDT) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 846EB43FE0 for ; Mon, 8 Sep 2003 00:43:20 -0700 (PDT) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.12.9/8.12.9) with ESMTP id h887hJqv055898; Mon, 8 Sep 2003 11:43:19 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Mon, 8 Sep 2003 11:43:19 +0400 (MSD) From: Dmitry Morozovsky To: Peter Pentchev In-Reply-To: <20030908070453.GO556@straylight.oblivion.bg> Message-ID: <20030908114113.A55683@woozle.rinet.ru> References: <20030907233940.M18589@woozle.rinet.ru> <3F5BB991.2050601@netli.com> <20030908070453.GO556@straylight.oblivion.bg> X-NCC-RegID: ru.rinet MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: if bpf fd's select()able? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2003 07:43:22 -0000 On Mon, 8 Sep 2003, Peter Pentchev wrote: PP> On Sun, Sep 07, 2003 at 04:04:49PM -0700, Lev Walkin wrote: PP> > Dmitry Morozovsky wrote: PP> > >Dear colleagues, PP> > > PP> > >[all below is for 4-STABLE] PP> > > PP> > >I'm trying to write effective arp scanner for multi-interface router (esp. PP> > >multi-vlan); I plan to use multiple bpf devices attached to different PP> > >interfaces emitting ARP requests and filters listening to ARP replies; the PP> > >most PP> > >natural way to multiplex them for me is select(). PP> > > PP> > >However, my tests show that select()ing bpf fd does not lead to trigger PP> > >packets PP> > >available to bpf filter; the process hangs in select state while parallel PP> > >tcpdump process shows packets desired *and* is in bpf state. PP> > > PP> > >Am I missing something "base"? References (surely, I'd already read PP> > >manpages for bpf, pcap and related -- but did I still missed something PP> > >serious?) would be greatly appreciated. PP> > PP> > Yes, you're missing the interactive mode. PP> > PP> > Refer to BIOCIMMEDIATE in the bpf(4) manual page. PP> PP> Also, I believe that for a month or so bpf devices have been able to PP> issue kqueue notifications, too, so - at least for FreeBSD - the "most PP> natural" way might now be kqueue() and not select() :) Thanks Peter, I'm aware of these recent changes; however, I plan to support at least one or two previous security branches, so kqueue ()is not the first option for me. Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------