Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Nov 2003 14:25:29 -0500
From:      Brian Fundakowski Feldman <green@FreeBSD.org>
To:        arch@FreeBSD.org
Cc:        fenner@FreeBSD.org
Subject:   bpf/pcap are weird
Message-ID:  <200311051925.hA5JPT6S003092@green.bikeshed.org>

next in thread | raw e-mail | index | archive | help
Okay, this is goofy stuff and breaks a lot of code that otherwise makes 
certain assumptions about pcap/bpf that don't work on FreeBSD.  Our bpf(4)
doesn't actually care about the non-blocking fd flag, and our pcap(3) 
doesn't care at all about BIOCIMMEDIATE.  Why do we have BIOCIMMEDIATE?  It 
seems like it's what SHOULD be implemented with the non-blocking I/O flag 
with the exception that if using O_NONBLOCK/FIONBIO you could actually query 
for the status, whereas you can't query for BIOCIMMEDIATE since it's only a 
SET and not a GET ioctl.

What's up with this?  Software that knows about pcap(3) but not bpf(4) on 
FreeBSD can't put the interface in the mode it wants to, and the 
non-blocking flag is settable and gettable but doesn't do anything.  
Wouldn't it be better to get rid of at least one of the interfaces, and 
provide a way to check what mode the bpf descriptor is in, either way?

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green@FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\




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