Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Sep 2003 11:43:19 +0400 (MSD)
From:      Dmitry Morozovsky <marck@rinet.ru>
To:        Peter Pentchev <roam@ringlet.net>
Cc:        hackers@freebsd.org
Subject:   Re: if bpf fd's select()able?
Message-ID:  <20030908114113.A55683@woozle.rinet.ru>
In-Reply-To: <20030908070453.GO556@straylight.oblivion.bg>
References:  <20030907233940.M18589@woozle.rinet.ru> <3F5BB991.2050601@netli.com> <20030908070453.GO556@straylight.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
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 ***
------------------------------------------------------------------------



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