if bpf fd's select()able?

Dmitry Morozovsky marck at rinet.ru
Mon Sep 8 00:43:22 PDT 2003

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> 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.

D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***

More information about the freebsd-hackers mailing list