From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 7 16:03:07 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 325E216A4BF for ; Sun, 7 Sep 2003 16:03:07 -0700 (PDT) Received: from smtp.netli.com (ip2-pal-focal.netli.com [66.243.52.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 562CA43FBD for ; Sun, 7 Sep 2003 16:03:06 -0700 (PDT) (envelope-from vlm@netli.com) Received: (qmail 29429 invoked by uid 84); 7 Sep 2003 23:03:06 -0000 Received: from vlm@netli.com by l3-1 with qmail-scanner-0.96 (uvscan: v4.1.40/v4121. . Clean. Processed in 0.147797 secs); 07 Sep 2003 23:03:06 -0000 Received: from unknown (HELO netli.com) (172.17.1.12) by mx01-pal-lan.netli.lan with SMTP; 7 Sep 2003 23:03:05 -0000 Message-ID: <3F5BB991.2050601@netli.com> Date: Sun, 07 Sep 2003 16:04:49 -0700 From: Lev Walkin Organization: Netli, Inc. User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030820 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: Dmitry Morozovsky References: <20030907233940.M18589@woozle.rinet.ru> In-Reply-To: <20030907233940.M18589@woozle.rinet.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: Sun, 07 Sep 2003 23:03:07 -0000 Dmitry Morozovsky wrote: > Dear colleagues, > > [all below is for 4-STABLE] > > I'm trying to write effective arp scanner for multi-interface router (esp. > multi-vlan); I plan to use multiple bpf devices attached to different > interfaces emitting ARP requests and filters listening to ARP replies; the most > natural way to multiplex them for me is select(). > > However, my tests show that select()ing bpf fd does not lead to trigger 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. Yes, you're missing the interactive mode. Refer to BIOCIMMEDIATE in the bpf(4) manual page. -- Lev Walkin vlm@netli.com