Bug FreeBSD BPF driver

Vladimir Yu. Stepanov vys at renet.ru
Fri Aug 29 02:54:48 PDT 2003


  Hello !

  In file sys/net/bpf.c CVS revision 1.95 introduce a error. It is wrong 
if a program use not default setting flag BIOCGSEESENT. Locally 
generated packet may be copy in user space if flag BIOCGSEESENT set to one.

http://vys.renet.ru/patchs/freebsd-5.1-bpf-1.2.patch

This patch required to allow more effective usage of BPF filter. It
marks every packet as "Incoming" or "Outgoing", in dependence of its 
direction (for given interface). Then, software which uses BPF filter 
can skip additional checking. After applying the patch, BPF filter 
interface still compatible with old software, but BPF_MINOR_VERSION has 
been changed. The structures bpf_hdr and related C code have been changed:
     - added field 'bh_flags' in 'bpf_hdr' structure with the following 
values:
         * BPF_DIRECT_INCOMING (0x4000)
         * BPF_DIRECT_OUTGOING (0x8000)
	this numbers (0x4000,0x8000) select for future export
	flags M_BCAST and M_MCAST in user space.
     - removed SIZEOF_BPF_HDR as not necessary.

-- 
SY. Vladimir Yu. Stepanov




More information about the freebsd-hackers mailing list