HomeFreeBSD

pflog: Correctly check if bpf peers are present

Description

pflog: Correctly check if bpf peers are present

On creating the pflog(4) interface, pflog_clone_create() does an
unconditional bpfattach(). Use bpf_peers_present() which was introduced
in commit 16d878cc99ef [1] to check the presence of bpf peers.

This will save a little CPU cycles when no bpf peers present. There
should be no functional change.

  1. 16d878cc99ef Fix the following bpf(4) race condition which can result in a panic

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45532

(cherry picked from commit ebc2bab04823c24c524f913457d6b88dc7ea9fac)

Details

Provenance
zleiAuthored on Sun, Jun 9, 1:05 AM
Reviewer
kp
Differential Revision
D45532: pflog: Correctly check if bpf peers are present
Parents
rG6ad2e347fcf8: bpf: Make bpf_peers_present a boolean inline function
Branches
Unknown
Tags
Unknown