if bpf fd's select()able?

Lev Walkin vlm at netli.com
Mon Sep 8 01:09:45 PDT 2003


Dmitry Morozovsky wrote:
> On Mon, 8 Sep 2003, Lev Walkin wrote:
> 
> [snip]
> 
> LW> > LW> Yes, you're missing the interactive mode.
> LW> > LW> Refer to BIOCIMMEDIATE in the bpf(4) manual page.
> LW> >
> LW> > Unfortunately not ;-)
> LW>
> LW> Fortunately, yes.
> LW>
> LW> > 	if (ioctl(fd, BIOCPROMISC, NULL) == -1)
> LW> > 		err(1, "can't set promisc mode");
> LW> > 	if (ioctl(fd, BIOCIMMEDIATE, &yes) == -1)
> LW> > 		err(1, "can't set IMMEDIATE mode");
> LW>
> LW> Are you sure that "yes" variable holds the truth value?
> 
> Yes. Just attaching file from wrong directory.
> 
> However, I found a (really stupid, yeah) bug: the first parameter of select()
> in this test case should be fd+1, not 1 ;-)

Unfortunately, this could not possibly be the case, if your system's
documentation is in sync with the reality:

=== select(2) ===
For historical reasons,
      select() will always examine the first 256 descriptors.
=== cut ===


-- 
Lev Walkin
vlm at netli.com



More information about the freebsd-hackers mailing list