From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 8 00:05:03 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 BB7BC16A4BF for ; Mon, 8 Sep 2003 00:05:03 -0700 (PDT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 860F643FF5 for ; Mon, 8 Sep 2003 00:05:01 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 17789 invoked from network); 8 Sep 2003 06:57:12 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 8 Sep 2003 06:57:11 -0000 Received: (qmail 74838 invoked by uid 1000); 8 Sep 2003 07:04:54 -0000 Date: Mon, 8 Sep 2003 10:04:54 +0300 From: Peter Pentchev To: Lev Walkin Message-ID: <20030908070453.GO556@straylight.oblivion.bg> Mail-Followup-To: Lev Walkin , Dmitry Morozovsky , hackers@freebsd.org References: <20030907233940.M18589@woozle.rinet.ru> <3F5BB991.2050601@netli.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWJxWxNlJUNgDlXi" Content-Disposition: inline In-Reply-To: <3F5BB991.2050601@netli.com> User-Agent: Mutt/1.5.4i cc: hackers@freebsd.org cc: Dmitry Morozovsky 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:05:03 -0000 --pWJxWxNlJUNgDlXi Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 07, 2003 at 04:04:49PM -0700, Lev Walkin wrote: > Dmitry Morozovsky wrote: > >Dear colleagues, > > > >[all below is for 4-STABLE] > > > >I'm trying to write effective arp scanner for multi-interface router (es= p. > >multi-vlan); I plan to use multiple bpf devices attached to different > >interfaces emitting ARP requests and filters listening to ARP replies; t= he=20 > >most > >natural way to multiplex them for me is select(). > > > >However, my tests show that select()ing bpf fd does not lead to trigger= =20 > >packets > >available to bpf filter; the process hangs in select state while parallel > >tcpdump process shows packets desired *and* is in bpf state. > > > >Am I missing something "base"? References (surely, I'd already read > >manpages for bpf, pcap and related -- but did I still missed something > >serious?) would be greatly appreciated. >=20 > Yes, you're missing the interactive mode. >=20 > Refer to BIOCIMMEDIATE in the bpf(4) manual page. Also, I believe that for a month or so bpf devices have been able to issue kqueue notifications, too, so - at least for FreeBSD - the "most natural" way might now be kqueue() and not select() :) G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If wishes were fishes, the antecedent of this conditional would be true. --pWJxWxNlJUNgDlXi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/XCoV7Ri2jRYZRVMRAijiAJ9MfH/4jtyV9ygSVLWitgAd/Rj8GwCfTc37 G4nrkpJXcPV9XgS69R7dIxo= =iPjd -----END PGP SIGNATURE----- --pWJxWxNlJUNgDlXi--