Page MenuHomeFreeBSD

Allow the BPF to be select for EVFILT_WRITE with kqueue.
Needs ReviewPublic

Authored by harti on Wed, Sep 15, 8:35 AM.

Details

Reviewers
None
Group Reviewers
network
Summary

Allow the BPF to be select for EVFILT_WRITE with kqueue. This is required for Boost asio to be able to use a BPF file descriptor even if it is used only for reading. Asio insists on installing a write filter.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 41523
Build 38412: arc lint + arc unit

Event Timeline

harti requested review of this revision.Wed, Sep 15, 8:35 AM
sys/net/bpf.c
2200

I'd prefer a bit less code duplication:

struct filterops *ops;

...

switch (kn->kn_filter) {
case EVFILT_READ:
   ops = &bpfread_filtops;
   break;
case EVFILT_WRITE:
   ops = &bpwrite_filtops;
   break;
default:
   return (EINVAL);
}

...

Also it seems you need to modify kqueue(2).